looking at the Vue official website tutorial, there are the following suggestions for adding multiple attributes:
= split line =
if you want to add new responsive attributes, don"t be like this:
Object.assign ( vm.userProfile , {
age: 27,
favoriteColor: "Vue Green"
})
you should do this:
vm.userProfile = Object.assign ( {} , vm.userProfile , {
age: 27,
favoriteColor: "Vue Green"
})
= split line =
is there a difference between the two ways of writing? It will destroy vm.userProfile anyway