vue给数组内的对象里面添加一个元素
that.$setchangeChoice(indexex,index){const that = this;let details= that.typeItems[indexex].details[index]if(details.hasOwnProperty('show')){details.show = !details.show;}else{that.$set(details,'show'
·
this.$set
changeChoice(indexex,index){
const that = this;
let details= that.typeItems[indexex].details[index]
if(details.hasOwnProperty('show')){
details.show = !details.show;
}else{
that.$set(details,'show',true);//给数组内的对象添加一个新的元素
}
},
更多推荐
已为社区贡献2条内容
所有评论(0)