未验证 提交 9361319f 编写于 作者: O openharmony_ci 提交者: Gitee

!22288 update prop demo

Merge pull request !22288 from 周末/cherry-pick-1692062422
...@@ -528,11 +528,11 @@ struct MyComponent { ...@@ -528,11 +528,11 @@ struct MyComponent {
} }
Row() { Row() {
Button('Click to change locally !').width(480).height(60).margin({ top: 10 }) Button('Click to change locally !').width(180).height(60).margin({ top: 10 })
.onClick(() => { .onClick(() => {
this.customCounter2++ this.customCounter2++
}) })
}.height(100).width(480) }.height(100).width(180)
Row() { Row() {
Text(`Custom Local: ${this.customCounter2}`).width(90).height(40).fontColor('#FF0010') Text(`Custom Local: ${this.customCounter2}`).width(90).height(40).fontColor('#FF0010')
...@@ -563,7 +563,7 @@ struct MainProgram { ...@@ -563,7 +563,7 @@ struct MainProgram {
MyComponent({ customCounter: this.mainCounter }) MyComponent({ customCounter: this.mainCounter })
// customCounter2也可以从父组件初始化,父组件初始化的值会覆盖子组件customCounter2的本地初始化的值 // customCounter2也可以从父组件初始化,父组件初始化的值会覆盖子组件customCounter2的本地初始化的值
MyComponent({ customCounter: this.mainCounter, customCounter2: this.mainCounter }) MyComponent({ customCounter: this.mainCounter, customCounter2: this.mainCounter })
}.width('40%') }
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册