Component的properties相关bug

发布于 6 年前作者 jyin10767 次浏览最后编辑 6 年前来自 ask

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

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

    }

  }
}

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

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

0 回复
暂无回复