请参考以下文档:https://gitee.com/openharmony/docs/blob/master/zh-cn/applicat...并参考以下demo:@Component struct activeDialog { @Builder customBuilder() { } // 使用父组件@Builder装饰的方法初始化子组件@BuilderParam @BuilderParam customBuilderParam: () => void = this.customBuilder; build() { Column({ space: 5 }) { Text('9998888888') // this.customBuilderParam() }.width('100%').height('100%').justifyContent(FlexAlign.Center) } } @Entry @Component struct Parent { @State isShow: boolean = true @Builder componentBuilder() { Text(`Parent builder `) } build() { Column() { activeDialog({ customBuilderParam: this.componentBuilder }) } .bindContentCover(this.isShow, this.componentBuilder(), { modalTransition: ModalTransition.NONE, // backgroundColor: 'rgba(0,0,0,0.5)', onAppear: () => { console.log("BindContentCover onAppear.") }, onDisappear: () => { console.log("BindContentCover onDisappear.") } }) } }
请参考以下文档:https://gitee.com/openharmony/docs/blob/master/zh-cn/applicat...
并参考以下demo: