Commit 1b12742c by 林家欣

修改中英文切换

parent a701517d
...@@ -72,8 +72,9 @@ export default { ...@@ -72,8 +72,9 @@ export default {
watch: { watch: {
$route: { $route: {
handler(val) { handler(val) {
const currentRouterComp = val.matched[val.matched.length-1].components.default.__file; console.log(val, 'val');
if (currentRouterComp.indexOf('English') !== -1) { const currentRouterComp = val.meta.language;
if (currentRouterComp.indexOf('英文') !== -1) {
this.languageTxt = '英文'; this.languageTxt = '英文';
} else { } else {
this.languageTxt = '中文'; this.languageTxt = '中文';
......
...@@ -1418,6 +1418,9 @@ const routes = [{ ...@@ -1418,6 +1418,9 @@ const routes = [{
children: [{ children: [{
path: "/EnglishHome", path: "/EnglishHome",
component: () => import("@/views/English/Home/index"), component: () => import("@/views/English/Home/index"),
meta: {
language: '英文'
},
}] }]
}, },
{ {
...@@ -1429,56 +1432,89 @@ const routes = [{ ...@@ -1429,56 +1432,89 @@ const routes = [{
path: "/SecondaryMenu/Introduction", path: "/SecondaryMenu/Introduction",
name: "Introduction", name: "Introduction",
component: () => import("@/views/English/SecondaryMenu/Introduction"), component: () => import("@/views/English/SecondaryMenu/Introduction"),
meta: {
language: '英文'
},
}, },
{ {
path: "/SecondaryMenu/Structure", path: "/SecondaryMenu/Structure",
name: "Structure", name: "Structure",
component: () => import("@/views/English/SecondaryMenu/Structure"), component: () => import("@/views/English/SecondaryMenu/Structure"),
meta: {
language: '英文'
},
}, },
{ {
path: "/SecondaryMenu/ContactUs", path: "/SecondaryMenu/ContactUs",
name: "ContactUs", name: "ContactUs",
component: () => import("@/views/English/SecondaryMenu/ContactUs"), component: () => import("@/views/English/SecondaryMenu/ContactUs"),
meta: {
language: '英文'
},
}, },
{ {
path: "/SecondaryMenu/Barcode", path: "/SecondaryMenu/Barcode",
name: "Barcode", name: "Barcode",
component: () => import("@/views/English/SecondaryMenu/Barcode"), component: () => import("@/views/English/SecondaryMenu/Barcode"),
meta: {
language: '英文'
},
}, },
{ {
path: "/SecondaryMenu/EPC", path: "/SecondaryMenu/EPC",
name: "EPC", name: "EPC",
component: () => import("@/views/English/SecondaryMenu/EPC"), component: () => import("@/views/English/SecondaryMenu/EPC"),
meta: {
language: '英文'
},
}, },
{ {
path: "/SecondaryMenu/GDSN", path: "/SecondaryMenu/GDSN",
name: "GDSN", name: "GDSN",
component: () => import("@/views/English/SecondaryMenu/GDSN"), component: () => import("@/views/English/SecondaryMenu/GDSN"),
meta: {
language: '英文'
},
}, },
{ {
path: "/SecondaryMenu/ECommerce", path: "/SecondaryMenu/ECommerce",
name: "ECommerce", name: "ECommerce",
component: () => import("@/views/English/SecondaryMenu/ECommerce"), component: () => import("@/views/English/SecondaryMenu/ECommerce"),
meta: {
language: '英文'
},
}, },
{ {
path: "/SecondaryMenu/HanXinCode", path: "/SecondaryMenu/HanXinCode",
name: "HanXinCode", name: "HanXinCode",
component: () => import("@/views/English/SecondaryMenu/HanXinCode"), component: () => import("@/views/English/SecondaryMenu/HanXinCode"),
meta: {
language: '英文'
},
}, },
{ {
path: "/SecondaryMenu/InnovativeSectors", path: "/SecondaryMenu/InnovativeSectors",
name: "InnovativeSectors", name: "InnovativeSectors",
component: () => import("@/views/English/SecondaryMenu/InnovativeSectors"), component: () => import("@/views/English/SecondaryMenu/InnovativeSectors"),
meta: {
language: '英文'
},
}, },
{ {
path: "/SecondaryMenu/industryPromotion", path: "/SecondaryMenu/industryPromotion",
name: "IndustryPromotion", name: "IndustryPromotion",
component: () => import("@/views/English/SecondaryMenu/industryPromotion"), component: () => import("@/views/English/SecondaryMenu/industryPromotion"),
meta: {
language: '英文'
},
}, },
{ {
path: "/SecondaryMenu/eLearning", path: "/SecondaryMenu/eLearning",
name: "eLearning", name: "eLearning",
component: () => import("@/views/English/SecondaryMenu/eLearning"), component: () => import("@/views/English/SecondaryMenu/eLearning"),
meta: {
language: '英文'
},
} }
] ]
}, },
...@@ -1490,16 +1526,25 @@ const routes = [{ ...@@ -1490,16 +1526,25 @@ const routes = [{
path: "/IndustryPromotion/FoodSafety", path: "/IndustryPromotion/FoodSafety",
name: "FoodSafety", name: "FoodSafety",
component: () => import("@/views/English/TertiaryMenu/IndustryPromotion/FoodSafety"), component: () => import("@/views/English/TertiaryMenu/IndustryPromotion/FoodSafety"),
meta: {
language: '英文'
},
}, },
{ {
path: "/IndustryPromotion/Healthcare", path: "/IndustryPromotion/Healthcare",
name: "Healthcare", name: "Healthcare",
component: () => import("@/views/English/TertiaryMenu/IndustryPromotion/Healthcare"), component: () => import("@/views/English/TertiaryMenu/IndustryPromotion/Healthcare"),
meta: {
language: '英文'
},
}, },
{ {
path: "/IndustryPromotion/Others", path: "/IndustryPromotion/Others",
name: "Others", name: "Others",
component: () => import("@/views/English/TertiaryMenu/IndustryPromotion/Others"), component: () => import("@/views/English/TertiaryMenu/IndustryPromotion/Others"),
meta: {
language: '英文'
},
} }
] ]
} }
......
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