2022-12-13 21:00:49 +08:00
|
|
|
<!--
|
|
|
|
* @Descripttion:
|
|
|
|
* @version:
|
|
|
|
* @Author: fzq
|
|
|
|
* @Date: 2022-11-25 09:51:46
|
|
|
|
* @LastEditors: fzq
|
|
|
|
* @LastEditTime: 2022-12-13 19:44:21
|
|
|
|
-->
|
2022-08-02 08:48:23 +08:00
|
|
|
<template>
|
2022-08-04 16:13:20 +08:00
|
|
|
<transition name="el-fade-in-linear">
|
|
|
|
<router-view />
|
|
|
|
</transition>
|
2022-08-02 08:48:23 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<style>
|
2022-08-04 16:13:20 +08:00
|
|
|
.el-table th.gutter {
|
|
|
|
display: table-cell !important;
|
|
|
|
}
|
2022-08-02 08:48:23 +08:00
|
|
|
</style>
|
|
|
|
<script>
|
|
|
|
import Cookies from 'js-cookie'
|
2022-12-13 21:00:49 +08:00
|
|
|
// import { messages } from '@/i18n'
|
2022-08-02 08:48:23 +08:00
|
|
|
export default {
|
2022-08-04 16:13:20 +08:00
|
|
|
watch: {
|
|
|
|
'$i18n.locale': 'i18nHandle'
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.i18nHandle(this.$i18n.locale)
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
i18nHandle(val, oldVal) {
|
|
|
|
Cookies.set('language', val)
|
|
|
|
document.querySelector('html').setAttribute('lang', val)
|
2022-12-13 21:00:49 +08:00
|
|
|
// 不注释掉会报错
|
|
|
|
// document.title = messages[val].brand.lg
|
2022-08-04 16:13:20 +08:00
|
|
|
// 非登录页面,切换语言刷新页面
|
|
|
|
if (this.$route.name !== 'login' && oldVal) {
|
|
|
|
window.location.reload()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-08-02 08:48:23 +08:00
|
|
|
}
|
|
|
|
</script>
|