vue中添加数据的方式有三种:
let vm = new vue({
data:{
school:{
name: 'zhang san',
age: '12'
}
}
});
vm.$set(vm.school,'address','beijing')
vm.school = vm.assign({},vm.school,{address:'bejing'})
vm.school = {...vm.school, ...{address:'bejing'}}//ES7,chorme@v60+
所有评论(0)