Vue中的$set的使用

改变数组的值

this.$set(this.children,1,666)

 

遍历改变数组中的对象

let that=this
this.children.forEach(function (value,i) {
that.$set(value,'aa',true);
});

posted @ 2017-09-07 12:16  fm060  阅读(621)  评论(0)    收藏  举报