0👍
Use watch
instead of a computed property.
watch:{
'$userData' = function(newValue){
...
this.name = newValue.name;
...
}
}
Get more info at: https://flaviocopes.com/vue-watchers/
PS: assuming, you can access $userData
throughout the Vue application.
- [Vuejs]-How to get `webpack.config.js` or `vue.config.js` file data globally in VueCLI 3
- [Vuejs]-How to refference input in vue js with v-model?
Source:stackexchange.com