这个提交包含在:
徐勤民 2025-05-22 18:58:14 +08:00
父节点 7b1ce19c39
当前提交 67a57048ad
共有 2 个文件被更改,包括 36 次插入0 次删除

查看文件

@ -57,6 +57,7 @@ export { WindowHelper } from './src/main/ets/utils/WindowHelper'
export { LoadingView } from './src/main/ets/view/LoadingView'
export { SafeView } from './src/main/ets/view/SafeView'
export { RefreshView } from './src/main/ets/view/refresh/RefreshView'
export { SwipeView } from './src/main/ets/view/SwipeView'
/**
* 自定义view
*/

查看文件

@ -0,0 +1,35 @@
@Component
export struct SwipeView {
@State h: Length = 40
@Builder
doNothingBuilder() {
}
@BuilderParam customBuilderParam: () => void = this.doNothingBuilder
// @BuilderParam btnBuilder: () => void = this.doNothingBuilder
build() {
Scroll() {
Row() {
this.customBuilderParam()
Text('删除')
.backgroundColor('red')
.width(70)
.fontColor('white')
.height(this.h)
.textAlign(TextAlign.Center)
.fontSize(16)
// if (this.btnBuilder === this.doNothingBuilder) {
// Text('删除')
// }
// if (this.btnBuilder !== this.doNothingBuilder) {
// this.btnBuilder()
// }
}.onSizeChange((oldValue: SizeOptions, newValue: SizeOptions) => {
this.h = newValue.height ?? 40
}).alignItems(VerticalAlign.Center)
}.width('100%').scrollable(ScrollDirection.Horizontal).scrollBar(BarState.Off)
}
}