fix_接口测试_首页用例跳转后没有高亮二级菜单 --bug=1007938 --user=王孝刚 【接口测试】首页用例跳转后没有高亮二级菜单 https://www.tapd.cn/55049933/s/1067670

This commit is contained in:
wxg0103 2021-11-16 14:25:40 +08:00 committed by fit2-zhao
parent 13776f32f0
commit 17381f701d
1 changed files with 11 additions and 1 deletions

View File

@ -3,7 +3,7 @@
<el-row type="flex">
<project-change :project-name="currentProject"/>
<el-col :span="14">
<el-menu class="header-menu" :unique-opened="true" mode="horizontal" router :default-active='$route.path'>
<el-menu class="header-menu" :unique-opened="true" mode="horizontal" router :default-active='currentPath'>
<el-menu-item :index="'/api/home'">
{{ $t("i18n.home") }}
@ -40,6 +40,7 @@ export default {
components: {SearchList, MsCreateButton, MsShowAll, MsRecentList, ProjectChange},
data() {
return {
currentPath: '',
testRecent: {
title: this.$t('load_test.recent'),
url: "/api/recent/5",
@ -64,6 +65,15 @@ export default {
currentProject: ''
};
},
watch: {
'$route': {
immediate: true,
handler(to) {
let path = to.path.split("/", 3);
this.currentPath = '/' + path[1] + '/' + path[2];
}
}
},
methods: {
reload() {
this.isRouterAlive = false;