码迷,mamicode.com
首页 > 其他好文 > 详细

Vue中的$set的使用

时间:2017-09-07 13:21:39      阅读:307      评论:0      收藏:0      [点我收藏+]

标签:foreach   this   改变   children   数组   遍历   child   nbsp   each   

改变数组的值

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

 

遍历改变数组中的对象

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

Vue中的$set的使用

标签:foreach   this   改变   children   数组   遍历   child   nbsp   each   

原文地址:http://www.cnblogs.com/fm060/p/7489050.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!