When dealing with files containing simple data like mutation.js for vuex, the structure often looks similar to this example:
export default {
...
someFunction() {}
...
}
Currently, I am facing an issue where I am unable to access this.
in order to utilize vue-i18n translations like this.$t('TRANS_TOKEN')
. To solve this problem, I considered including Vue in the file using: import vue from 'vue'
and then attempting to use vue.$t(..)
, but unfortunately, that approach did not work as expected.