vue给数组内的对象里面添加一个元素

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);//给数组内的对象添加一个新的元素
	}
},

你可能感兴趣的:(vue.js,前端,javascript)