1、解决跳转一个新界面的问题 并且当前页面不能跳转到大屏

20245024-wz
qiuyt 5 months ago
parent efe4398584
commit 4627d4ae51

@ -1,14 +1,16 @@
<template>
<div v-if="!item.hidden">
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)">
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
<app-link v-if="onlyOneChild.meta" :to="resolvePathParent(onlyOneChild.path, onlyOneChild.query)">
<el-menu-item @click="menuClick" :index="resolvePathParent(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
<item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />
</el-menu-item>
</app-link>
</template>
<el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
<el-submenu v-else ref="subMenu" :index="resolvePathParent(item.path)" popper-append-to-body>
<template slot="title">
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
</template>
@ -17,7 +19,7 @@
:key="child.path"
:is-nest="true"
:item="child"
:base-path="resolvePath(child.path)"
:base-path="resolvePathParent(child.path)"
class="nest-menu"
/>
</el-submenu>
@ -52,10 +54,13 @@ export default {
},
data() {
this.onlyOneChild = null
return {}
return {
dapingIndexSwitch:false
}
},
methods: {
hasOneShowingChild(children = [], parent) {
if (!children) {
children = [];
}
@ -93,8 +98,47 @@ export default {
let query = JSON.parse(routeQuery);
return { path: path.resolve(this.basePath, routePath), query: query }
}
return path.resolve(this.basePath, routePath)
}
},
resolvePathParent(routePath, routeQuery){
var path = this.resolvePath(routePath, routeQuery);
// console.log('path===',path,routeQuery)
// if(path == '/daping/mapIndex'){
// path = '/index123'
// this.dapingIndexSwitch = true
// }
return path;
},
menuClick(item){
var path = item.index
// // if(this.dapingIndexSwitch){
// // path = '/daping/mapIndex'
// // this.dapingIndexSwitch = false
// // }else {
// // path = ss.index
// // }
//
if(path == '/daping/mapIndex'){
const routeData = this.$router.resolve(
{
path:path
}
);
window.open(routeData.href,'_blank');
console.log('ffffff')
window.location.href = '/index'
// bbb();
}
},
}
}
</script>

@ -52,6 +52,10 @@ export default {
isCollapse() {
return !this.sidebar.opened;
}
}
},
methods: {
}
};
</script>

Loading…
Cancel
Save