63 lines
1.5 KiB
Vue
63 lines
1.5 KiB
Vue
<!--
|
|
* @Author: hisense.wuhongjian
|
|
* @Date: 2022-06-14 09:30:22
|
|
* @LastEditors: hisense.wuhongjian
|
|
* @LastEditTime: 2022-11-11 11:06:48
|
|
* @Description: 告诉大家这是什么
|
|
-->
|
|
<template>
|
|
<transition name="el-fade-in-linear">
|
|
<router-view />
|
|
</transition>
|
|
</template>
|
|
|
|
<style>
|
|
.el-table th.gutter{
|
|
display: table-cell !important;
|
|
}
|
|
|
|
.el-button {
|
|
vertical-align: middle !important;
|
|
align-items: center !important;
|
|
display: inline-flex !important;
|
|
height:32px !important;
|
|
line-height: 32px !important;
|
|
justify-content: center !important;
|
|
min-width: 80px !important;
|
|
border-radius:2px !important;
|
|
}
|
|
.el-button--primary {
|
|
vertical-align: middle !important;
|
|
align-items: center !important;
|
|
display: inline-flex !important;
|
|
height:32px !important;
|
|
line-height: 32px !important;
|
|
justify-content: center !important;
|
|
min-width: 80px !important;
|
|
border-radius:2px !important;
|
|
}
|
|
</style>
|
|
<script>
|
|
import Cookies from 'js-cookie'
|
|
import { messages } from '@/i18n'
|
|
export default {
|
|
watch: {
|
|
'$i18n.locale': 'i18nHandle'
|
|
},
|
|
created () {
|
|
this.i18nHandle(this.$i18n.locale)
|
|
},
|
|
methods: {
|
|
i18nHandle (val, oldVal) {
|
|
Cookies.set('language', val)
|
|
document.querySelector('html').setAttribute('lang', val)
|
|
document.title = messages[val].brand.lg
|
|
// 非登录页面,切换语言刷新页面
|
|
if (this.$route.name !== 'login' && oldVal) {
|
|
window.location.reload()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|