Commit a0b5468189627a8b5d914d818b11c0bbd2af9148

Authored by panlinlin
1 parent 04f3511f

修复进入通道页面时导航显示异常

web_src/src/components/UiHeader.vue
1 1 <template>
2 2 <div id="UiHeader">
3   - <el-menu router :default-active="this.$route.path" menu-trigger="click" background-color="#545c64" text-color="#fff" active-text-color="#ffd04b" mode="horizontal">
  3 + <el-menu router :default-active="activeIndex" menu-trigger="click" background-color="#545c64" text-color="#fff" active-text-color="#ffd04b" mode="horizontal">
4 4 <el-menu-item index="/">控制台</el-menu-item>
5 5 <el-menu-item index="/deviceList">设备列表</el-menu-item>
6 6 <el-menu-item index="/pushVideoList">推流列表</el-menu-item>
... ... @@ -29,6 +29,7 @@ export default {
29 29 return {
30 30 alarmNotify: true,
31 31 sseSource: null,
  32 + activeIndex: this.$route.path,
32 33 };
33 34 },
34 35 methods:{
... ... @@ -88,6 +89,11 @@ export default {
88 89 }
89 90 }
90 91 },
  92 + created(){
  93 + if (this.$route.path.startsWith("/channelList")){
  94 + this.activeIndex = "/deviceList"
  95 + }
  96 + },
91 97 mounted() {
92 98 window.addEventListener('beforeunload', e => this.beforeunloadHandler(e))
93 99 // window.addEventListener('unload', e => this.unloadHandler(e))
... ...