Component的properties相关bug
发布于 4 年前 作者 jyin 10636 次浏览 来自 问答

在properties属性中type为Array的observer中用setData改变该属性的值,会出现无限递归调用observer

Component({
  properties: {
    room: {
      type: Array,
      observer(room) {
        this.setData({ room: [] })
      }

    }

  }
}

type为String的正常,未测试其他类型。

在真机和模拟器上都可出现

回到顶部