Commit 1b12742c by 林家欣

修改中英文切换

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