export default {
data() {
return {
obj: {
a: 1,
b: 2
}
}
}
}
// 给obj添加新属性
// 1
this.$set(this.obj1, ‘c‘, 3)
// 2
Object.assign({}, this.obj, { c: 3 })
原文:https://www.cnblogs.com/Yancyzheng/p/13215458.html