未验证 提交 38247fcb 编写于 作者: 1 189******51 提交者: Gitee

update zh-cn/application-dev/quick-start/arkts-builderparam.md.

Signed-off-by: N189******51 <lipeicheng5@huawei.com>
上级 0a33c57c
......@@ -34,8 +34,8 @@
- 用父组件自定义构建函数初始化子组件\@BuildParam装饰的方法。
```ts
@Component
struct Child {
@Component
struct Child {
@Builder componentBuilder() {
Text(`Parent builder `)
}
......@@ -47,11 +47,11 @@ struct Child {
this.aBuilder0()
}
}
}
}
@Entry
@Component
struct Parent {
@Entry
@Component
struct Parent {
@Builder componentBuilder() {
Text(`Parent builder `)
}
......@@ -61,7 +61,7 @@ struct Parent {
Child({ aBuilder0: this.componentBuilder })
}
}
}
}
```
......@@ -74,8 +74,8 @@ struct Parent {
> 开发者谨慎使用bind改变函数调用的上下文,可能会使this指向混乱。
```ts
@Component
struct Child {
@Component
struct Child {
@Builder componentBuilder() {
Text(`Child builder `)
}
......@@ -90,11 +90,11 @@ struct Child {
this.aBuilder1()
}
}
}
}
@Entry
@Component
struct Parent {
@Entry
@Component
struct Parent {
label: string = `Parent`
@Builder componentBuilder() {
......@@ -107,7 +107,7 @@ struct Parent {
Child({ aBuilder0: this.componentBuilder, aBuilder1: this.componentBuilder })
}
}
}
}
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册