Commit c616fb46 by 林家欣

优化中英文切换代码

parent 1b12742c
......@@ -72,12 +72,11 @@ export default {
watch: {
$route: {
handler(val) {
console.log(val, 'val');
const currentRouterComp = val.meta.language;
if (currentRouterComp.indexOf('英文') !== -1) {
this.languageTxt = '英文';
if (currentRouterComp && currentRouterComp.indexOf("英文") !== -1) {
this.languageTxt = "英文";
} else {
this.languageTxt = '中文';
this.languageTxt = "中文";
}
},
immediate: true,
......@@ -87,7 +86,7 @@ export default {
this.user = localStorage.getItem("loginInfo")
? JSON.parse(localStorage.getItem("loginInfo"))
: {};
console.log(this.user);
// console.log(this.user);
},
data() {
return {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment