美文网首页
$set的用法

$set的用法

作者: AR7_ | 来源:发表于2018-08-08 10:39 被阅读13次

1、点击取消按钮,重复赋值,因为使用push,会出现重复数据,使用$set解决。

      let index = 0
      for (var key in this.data) {
        this.$set(this.radioButtonList, index, key)
        index += 1
        // this.radioButtonList.push(key)
      }
      this.radioButtonList.sort()

相关文章

网友评论

      本文标题:$set的用法

      本文链接:https://www.haomeiwen.com/subject/fmetbftx.html