App.vue 687 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <div id="app">
  3. <router-view />
  4. </div>
  5. </template>
  6. <script>
  7. import { mapActions } from 'vuex'
  8. import { setLang } from '@/utils/auth'
  9. export default {
  10. name: 'app',
  11. watch: {
  12. '$i18n.locale': 'i18nHandle'
  13. },
  14. created() {
  15. this.i18nHandle(this.$i18n.locale)
  16. },
  17. mounted() {
  18. // 清楚缓存的设置租户ID
  19. this.setDesignTenantid('')
  20. },
  21. methods: {
  22. ...mapActions({
  23. 'setDesignTenantid': 'ibps/user/setDesignTenantid'
  24. }),
  25. i18nHandle(val, oldVal) {
  26. setLang(val)
  27. document.querySelector('html').setAttribute('lang', val)
  28. }
  29. }
  30. }
  31. </script>
  32. <style lang="scss">
  33. @import '~@/assets/styles/public-class.scss';
  34. </style>