中国优质的IT技术网站
专业IT技术创作平台
IT职业在线教育平台
微信扫码分享
class Tmp { paramA1: string = '' } @Builder function overBuilder(params: Tmp) { Row() { Text(`overBuilder: ${params.paramA1} `) } } @Builder function overBuilder2(params: Tmp) { Row() { Text(`overBuilder2: ${params.paramA1} `) } } @Entry @Component struct Index123 { @State label: string = 'Hello'; @State buildSet: boolean = false; build() { Row() { Column() { if(this.buildSet){ overBuilder({ paramA1: this.label }) }else{ overBuilder2({ paramA1: this.label }) } } .width('100%') } .height('100%') } }