fix:首页切换

This commit is contained in:
wenyann 2020-12-18 12:58:17 +08:00
parent 3db39fb276
commit 602e500926
3 changed files with 17 additions and 7 deletions

View File

@ -3,7 +3,6 @@ import MsProject from "@/business/components/settings/project/MsProject";
export default { export default {
path: "/api", path: "/api",
name: "api", name: "api",
redirect: "/api/home",
components: { components: {
content: () => import('@/business/components/api/ApiTest') content: () => import('@/business/components/api/ApiTest')
}, },

View File

@ -11,7 +11,7 @@
<el-menu-item index="/track" v-permission="['test_manager','test_user','test_viewer']"> <el-menu-item index="/track" v-permission="['test_manager','test_user','test_viewer']">
{{ $t('test_track.test_track') }} {{ $t('test_track.test_track') }}
</el-menu-item> </el-menu-item>
<el-menu-item index="/api" v-permission="['test_manager','test_user','test_viewer']"> <el-menu-item index="/api" @click="active()" v-permission="['test_manager','test_user','test_viewer']">
{{ $t('commons.api') }} {{ $t('commons.api') }}
</el-menu-item> </el-menu-item>
<el-menu-item index="/performance" onselectstart="return false" <el-menu-item index="/performance" onselectstart="return false"
@ -47,7 +47,18 @@
}, },
methods: { methods: {
handleSelect(index) { handleSelect(index) {
console.log(index)
this.activeIndex = index this.activeIndex = index
},
active() {
if (this.activeIndex === '/api') {
if (this.$store.state.switch.value == 'new') {
window.location.href = "/#/api/home";
} else if (this.$store.state.switch.value == 'old') {
window.location.href = "/#/api/home_obsolete";
}
}
} }
} }
} }

@ -1 +1 @@
Subproject commit d39dafaf84b9c7a56cb51f2caf67dd7dfde5938c Subproject commit 010ad7a5f072a5e9d368c756a2473bbd20781433