数组: 根据VUE官网: 数组修改: 修改数组某个元素的值: Vue.set(this.items, indexOfItem, newValue); this.$set(this.items, indexOfItem, newValue); this.items.splice(indexOfItem Read More
//声明对象 data() { return { obj: { name: '黄国华' } } }, watch: { obj: { handler: function(newVal, oldVal) { console.log(newVal, oldVal); //因为对象为引用类型数据,所以新旧 Read More