i18n-mixin.js 256 B

12345678910111213141516
  1. import { mapState } from 'vuex'
  2. const i18nMixin = {
  3. computed: {
  4. ...mapState({
  5. currentLang: state => state.app.lang
  6. })
  7. },
  8. methods: {
  9. setLang (lang) {
  10. this.$store.dispatch('setLang', lang)
  11. }
  12. }
  13. }
  14. export default i18nMixin