vue中添加数据的方式

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+

你可能感兴趣的:(vue中添加数据的方式)