提交 8253d394 authored 作者: matian's avatar matian

updates

上级 95a26b98
...@@ -30,11 +30,7 @@ ...@@ -30,11 +30,7 @@
</client-only> </client-only>
</template> </template>
<div class="language"> <div class="language">
<span <span @click="switchLocale('zh-CN')" :class="isEn === false ? 'cn' : ''">中文</span>/<span
@click="switchLocale('zh-CN')"
:class="isEn === false ? 'cn' : ''"
>中文</span
>/<span
:class="isEn === true ? 'cn' : ''" :class="isEn === true ? 'cn' : ''"
@click="switchLocale('en-US')" @click="switchLocale('en-US')"
>EN</span >EN</span
...@@ -49,37 +45,21 @@ ...@@ -49,37 +45,21 @@
<div :class="getNameActive(item)"> <div :class="getNameActive(item)">
<template v-if="!item.path"> <template v-if="!item.path">
<template v-if="item.click"> <template v-if="item.click">
<span <span @click="showEnroll" v-html="item.name" :class="isEn === true ? 'name1' : ''"></span>
@click="showEnroll"
v-html="item.name"
:class="isEn === true ? 'name1' : ''"
></span>
</template>
<template
v-else
v-html="item.name"
:class="isEn === true ? 'name1' : ''"
>
</template> </template>
<template v-else v-html="item.name" :class="isEn === true ? 'name1' : ''"> </template>
</template> </template>
<template v-else> <template v-else>
<nuxt-link :to="item.path"> <nuxt-link :to="item.path">
<div <div v-html="item.name" :class="isEn === true ? 'name1' : ''"></div
v-html="item.name"
:class="isEn === true ? 'name1' : ''"
></div
></nuxt-link> ></nuxt-link>
</template> </template>
</div> </div>
<div class="child-item" v-if="item.childern && "> <div class="child-item" v-if="item.childern">
<div class="one-level"> <div class="one-level">
<template v-for="(level2Item, level2Index) in item.childern"> <template v-for="(level2Item, level2Index) in item.childern">
<div <div
:class=" :class="$route.path === level2Item.path || level2Item.isShow ? 'li active' : 'li'"
$route.path === level2Item.path || level2Item.isShow
? 'li active'
: 'li'
"
:key="level2Index + 'level2'" :key="level2Index + 'level2'"
@mouseenter="levelShow(level2Item)" @mouseenter="levelShow(level2Item)"
@mouseleave="levelShow(level2Item, 'out')" @mouseleave="levelShow(level2Item, 'out')"
...@@ -90,10 +70,7 @@ ...@@ -90,10 +70,7 @@
:class="isEn === true ? 'name1' : ''" :class="isEn === true ? 'name1' : ''"
v-html="level2Item.name" v-html="level2Item.name"
></div> ></div>
<div <div class="el-icon-arrow-right" v-if="level2Item.childern"></div>
class="el-icon-arrow-right"
v-if="level2Item.childern"
></div>
</div> </div>
</template> </template>
</div> </div>
...@@ -173,6 +150,7 @@ export default { ...@@ -173,6 +150,7 @@ export default {
name: this.$t('menu.baseChild.laboratory'), name: this.$t('menu.baseChild.laboratory'),
path: '/practice/laboratory', path: '/practice/laboratory',
isShow: false, isShow: false,
childern: [ childern: [
{ {
name: '商业数据分析实验室', name: '商业数据分析实验室',
...@@ -429,9 +407,9 @@ export default { ...@@ -429,9 +407,9 @@ export default {
} }
}, },
navLeave() { navLeave() {
this.navData.map((item) => { this.navData.map(item => {
if (item.childern) { if (item.childern) {
item.childern.map((cItem) => { item.childern.map(cItem => {
cItem.isShow = false cItem.isShow = false
}) })
} }
...@@ -449,14 +427,14 @@ export default { ...@@ -449,14 +427,14 @@ export default {
}, },
computed: { computed: {
getNameActive() { getNameActive() {
return (item) => { return item => {
const currentPath = this.$route.path const currentPath = this.$route.path
if (currentPath.includes(item.path)) { if (currentPath.includes(item.path)) {
return 'name active' return 'name active'
} else { } else {
let className = 'name' let className = 'name'
if (item.childern) { if (item.childern) {
item.childern.map((cData) => { item.childern.map(cData => {
cData.path === currentPath && (className = 'name active') cData.path === currentPath && (className = 'name active')
}) })
} }
...@@ -469,18 +447,14 @@ export default { ...@@ -469,18 +447,14 @@ export default {
}, },
loginURL() { loginURL() {
return process.client return process.client
? `${ ? `${process.env.loginURL}/login/index?redirect_uri=${encodeURIComponent(
process.env.loginURL
}/login/index?redirect_uri=${encodeURIComponent(
location.origin + this.$route.fullPath location.origin + this.$route.fullPath
)}` )}`
: '' : ''
}, },
registerURL() { registerURL() {
return process.client return process.client
? `${process.env.loginURL}/register?redirect_uri=${encodeURIComponent( ? `${process.env.loginURL}/register?redirect_uri=${encodeURIComponent(location.origin + this.$route.fullPath)}`
location.origin + this.$route.fullPath
)}`
: '' : ''
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论