<!--
 * @Descripttion: 
 * @version: 
 * @Author: fzq
 * @Date: 2022-11-25 09:51:46
 * @LastEditors: fzq
 * @LastEditTime: 2023-01-13 15:13:05
-->
<template>
	<transition name="el-fade-in-linear"  id="app">
		<router-view />
	</transition>
</template>

<style>
.el-table th.gutter {
	display: table-cell !important;
}
#app {
background-color: #f2f4f9;
}
</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>

