diff --git a/ArkUI/entry/src/main/ets/pages/CanCustomComponentsBeSavedInContainers.ets b/ArkUI/entry/src/main/ets/pages/CanCustomComponentsBeSavedInContainers.ets index 30cdcf184518a3385c292de4ba206fe295b2c2df..ffc6ff02a42c1730e3478decc52a86ce3924996e 100644 --- a/ArkUI/entry/src/main/ets/pages/CanCustomComponentsBeSavedInContainers.ets +++ b/ArkUI/entry/src/main/ets/pages/CanCustomComponentsBeSavedInContainers.ets @@ -67,10 +67,10 @@ function buildComC() { } //Encapsulate in container through map -let map: Map> = new Map() -map.set('ComA', wrapBuilder(buildComA)) -map.set('ComB', wrapBuilder(buildComB)) -map.set('ComC', wrapBuilder(buildComC)) +let map: Map> = new Map(); +map.set('ComA', wrapBuilder(buildComA)); +map.set('ComB', wrapBuilder(buildComB)); +map.set('ComC', wrapBuilder(buildComC)); @Component struct Page12 { @@ -89,4 +89,5 @@ struct Page12 { .height('100%') } } + // [End can_custom_components_be_saved_in_containers] \ No newline at end of file diff --git a/ArkUI/entry/src/main/ets/pages/ResolvingIsNotCallable.ets b/ArkUI/entry/src/main/ets/pages/ResolvingIsNotCallable.ets index 2d499f87665eef38e2d2cfd3c8622df92a373bc3..79256f6f3de1c9b3680ae1157efaf916acc6ee73 100644 --- a/ArkUI/entry/src/main/ets/pages/ResolvingIsNotCallable.ets +++ b/ArkUI/entry/src/main/ets/pages/ResolvingIsNotCallable.ets @@ -20,7 +20,9 @@ // [Start resolving_is_not_callable_one] @Component struct Child { - @Builder FunABuilder0() {} + @Builder + FunABuilder0() {}; + @BuilderParam aBuilder0: () => void = this.FunABuilder0; build() { @@ -33,15 +35,16 @@ struct Child { @Entry @Component struct Parent { - @Builder componentBuilder() { + @Builder + componentBuilder() { Text('Parent builder') - .onClick(()=>{ + .onClick(() => { this.test1(); }) } test1(): void { - console.log('test1'); + console.info('test1'); } build() { @@ -50,20 +53,26 @@ struct Parent { } } } + // [End resolving_is_not_callable_one] @Component struct ChildTest { - @Builder componentBuilder() { + @Builder + componentBuilder() { Text('Parent builder') - .onClick(()=>{ + .onClick(() => { }) } build() { // [Start resolving_is_not_callable_two] - Child({ aBuilder0:()=>{ this.componentBuilder() } }) + Child({ + aBuilder0: () => { + this.componentBuilder() + } + }) // [End resolving_is_not_callable_two] } }