Vue——this.$set()赋值方法
data() {return {label: [{id:1}]}},demo () {this.$set(this.label, "name", '小明');console.log(this.label)// label: [{id:1, name: '小明'}]}
·
data() {
return {
label: [{id:1}]
}
},
demo () {
this.$set(this.label, "name", '小明');
console.log(this.label)
// label: [{id:1, name: '小明'}]
}
更多推荐
已为社区贡献12条内容
所有评论(0)