vue change deep element
Vue.set(vm.someObject, 'b', 2) //for objects
Vue.set(vm.items, indexOfItem, newValue) //forarrays
vue change deep element
Vue.set(vm.someObject, 'b', 2) //for objects
Vue.set(vm.items, indexOfItem, newValue) //forarrays
vue watch child property
...
watch:{
'item.someOtherProp'(newVal){
//to work with changes in "myArray"
},
'item.prop'(newVal){
//to work with changes in prop
}
}
watch nested data vue
var vm = new Vue({
el: '#app',
computed: {
foo() {
return this.item.foo;
}
},
watch: {
foo() {
console.log('Foo Changed!');
}
},
data: {
item: {
foo: 'foo'
}
}
})
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us