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

IssueNo: #I7XVG3:[新需求]: Rectify the arkts syntax 3

Description: Rectify the arkts syntax in arkts-extend.md.
Sig: SIG_ApplicaitonFramework
Feature or Bugfix: Feature
Binary Source: No
Signed-off-by: N189******51 <lipeicheng5@huawei.com>
上级 12816922
...@@ -64,27 +64,27 @@ ...@@ -64,27 +64,27 @@
- \@Extend装饰的方法的参数可以为function,作为Event事件的句柄。 - \@Extend装饰的方法的参数可以为function,作为Event事件的句柄。
```ts ```ts
@Extend(Text) function makeMeClick(onClick: () => void) { @Extend(Text) function makeMeClick(onClick: () => void) {
.backgroundColor(Color.Blue) .backgroundColor(Color.Blue)
.onClick(onClick) .onClick(onClick)
} }
@Entry @Entry
@Component @Component
struct FancyUse { struct FancyUse {
@State label: string = 'Hello World'; @State label: string = 'Hello World';
onClickHandler() { onClickHandler() {
this.label = 'Hello ArkUI'; this.label = 'Hello ArkUI';
} }
build() { build() {
Row({ space: 10 }) { Row({ space: 10 }) {
Text(`${this.label}`) Text(`${this.label}`)
.makeMeClick(this.onClickHandler) .makeMeClick(this.onClickHandler)
}
} }
} }
}
``` ```
- \@Extend的参数可以为[状态变量](arkts-state-management-overview.md),当状态变量改变时,UI可以正常的被刷新渲染。 - \@Extend的参数可以为[状态变量](arkts-state-management-overview.md),当状态变量改变时,UI可以正常的被刷新渲染。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册