[Vuejs]-How to re-render vue js using emit event

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')
    }
  }
}

Leave a comment