diff --git a/zh-cn/application-dev/quick-start/arkts-extend.md b/zh-cn/application-dev/quick-start/arkts-extend.md index a238b695b6aef5690786b85dda96363544383a9e..cfea43912c423e5ec55860cae8ebc0b7d8a500d7 100644 --- a/zh-cn/application-dev/quick-start/arkts-extend.md +++ b/zh-cn/application-dev/quick-start/arkts-extend.md @@ -64,27 +64,27 @@ - \@Extend装饰的方法的参数可以为function,作为Event事件的句柄。 ```ts -@Extend(Text) function makeMeClick(onClick: () => void) { - .backgroundColor(Color.Blue) - .onClick(onClick) -} + @Extend(Text) function makeMeClick(onClick: () => void) { + .backgroundColor(Color.Blue) + .onClick(onClick) + } -@Entry -@Component -struct FancyUse { - @State label: string = 'Hello World'; + @Entry + @Component + struct FancyUse { + @State label: string = 'Hello World'; - onClickHandler() { - this.label = 'Hello ArkUI'; - } + onClickHandler() { + this.label = 'Hello ArkUI'; + } - build() { - Row({ space: 10 }) { - Text(`${this.label}`) - .makeMeClick(this.onClickHandler) + build() { + Row({ space: 10 }) { + Text(`${this.label}`) + .makeMeClick(this.onClickHandler) + } } } -} ``` - \@Extend的参数可以为[状态变量](arkts-state-management-overview.md),当状态变量改变时,UI可以正常的被刷新渲染。