Skip to content

Instantly share code, notes, and snippets.

@hoangtuan151
Created March 24, 2020 04:49
Show Gist options
  • Save hoangtuan151/52569e63ccd66f444feb51e594e8e24f to your computer and use it in GitHub Desktop.
Save hoangtuan151/52569e63ccd66f444feb51e594e8e24f to your computer and use it in GitHub Desktop.
import {localeMixin} from '@/utils/locale-mixin'
export default {
mixins: [localeMixin],
computed: {
currentLocale () {
return this.$i18n.locale.toUpperCase()
}
},
methods: {
changeLocale () {
if (this.currentLocale === 'EN') {
this.$store.commit('SET_APP_LOCALE', 'vn')
} else {
this.$store.commit('SET_APP_LOCALE', 'en')
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment