处理模块之间跳转后,地址栏和二级路由选中的菜单不匹配的问题

This commit is contained in:
renpy 2023-08-01 16:50:41 +08:00
parent 8772c16c9b
commit 39c519b818

View File

@ -41,7 +41,16 @@ export default {
methods: {
onMenuSelect({ key }) {
const childPath = this.getChildrenPath(this.menuItems.find(menu => menu.name === key))
this.$router.push(childPath)
if (key == "abnormal-alarm" || key == "istatistics") {
const selectedKeys = window.sessionStorage.getItem('currMenu')
if (selectedKeys) {
this.$router.push(selectedKeys)
} else {
this.$router.push(childPath)
}
} else {
this.$router.push(childPath)
}
},
getChildrenPath(menuItem) {
if (menuItem.children) {