From 90e17bf7c366cd2fcc6fe1b4dc0a7b969e59e59a Mon Sep 17 00:00:00 2001 From: ywcoder <1104410818@qq.com> Date: Fri, 5 Sep 2025 15:03:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=8A=A0=E5=88=86=E5=8F=B7?= =?UTF-8?q?=EF=BC=8Cconsole.log=E6=94=B9=E4=B8=BA.info?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...CanCustomComponentsBeSavedInContainers.ets | 9 ++++---- .../main/ets/pages/ResolvingIsNotCallable.ets | 23 +++++++++++++------ 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/ArkUI/entry/src/main/ets/pages/CanCustomComponentsBeSavedInContainers.ets b/ArkUI/entry/src/main/ets/pages/CanCustomComponentsBeSavedInContainers.ets index 30cdcf18..ffc6ff02 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 2d499f87..79256f6f 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] } } -- Gitee