<div style="width:130px;height:40px;line-height:40px;">
<button style="border:none;background:none;height:40px;vertical-align: middle;font-weight:600;float:left"><i class="iconaixin iconfont" style="vertical-align: middle;"></i>点赞</button>
<button v-on:click="publishComment(dynamic._id,index)" style="border:none;background:none;height:40px;vertical-align: middle;float:right;font-weight:600;" ><i class="iconxiaoxi iconfont" style="vertical-align: middle;"></i>评论</button>
</div>
publishComment(_id,index){
var _this = this;
_this.$set(_this.dynamicLists[index],'publishComment',true)
console.log(this.dynamicLists[index].publishComment)
console.log(this.dynamicLists)
}
相通过点击事件修改数组里面的值,this.$set未能及时更新视图,只修改了数组里面的数据,向大佬请教?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…