📜  vuejs 设置 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:30.853000             🧑  作者: Mango

代码示例1
Vue.set(vm.someObject, 'propertyName', value)
// Or using alias
this.$set(this.someObject, 'propertyName', value)
// For an array, simply repalce propertyName with the index
this.$set(this.someArray, indexOfItem, value)
// Or assign new props to an object
this.someObject = Object.assign({}, this.someObject, { a: 1, b: 2 })