1 Star 0 Fork 5.3K

piggyguy_jdx / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
arkts-two-way-sync.md 3.72 KB
一键复制 编辑 原始数据 按行查看 历史

$$语法:内置组件双向同步

$$运算符为系统内置组件提供TS变量的引用,使得TS变量和系统内置组件的内部状态保持同步。

内部状态具体指什么取决于组件。例如,bindPopup属性方法的show参数。

使用规则

使用示例

bindPopup属性方法的show参数为例:

// xxx.ets
@Entry
@Component
struct bindPopupPage {
  @State customPopup: boolean = false;

  build() {
    Column() {
      Button('Popup')
        .margin(20)
        .onClick(() => {
          this.customPopup = !this.customPopup
        })
        .bindPopup($$this.customPopup, {
          message: 'showPopup'
        })
    }
  }
}

popup

1
https://gitee.com/piggyguy/docs.git
git@gitee.com:piggyguy/docs.git
piggyguy
docs
docs
master

搜索帮助