2👍
✅
The data properties set in the data
method are only set once during the Vue instance’s initialization.
If you want the language
property to update based on the current state of the globalStore.language
value, you should make it a computed property:
export default {
name: "sample",
computed: {
language() {
return globalStore.translate
}
},
methods: {
changeLanguage() {
globalStore.$emit('changeLanguage')
}
}
}
Source:stackexchange.com