站点选择下拉框的数据获取、存储处理逻辑更新,解决因为多层router-view嵌套,二级路由以上页面不会被缓存的而导致单站监控页面站点选择下拉框闪烁的问题
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
|
||||
<template>
|
||||
<div class="ems-dashboard-editor-container">
|
||||
<zd-select :default-site-id="$route.query.siteId" @submitSite="submitSite"/>
|
||||
<zd-select :get-list-by-store="true" :default-site-id="$route.query.siteId" @submitSite="submitSite"/>
|
||||
<!-- 这里是单站监控的二级菜单栏 需要循环拿到数据 显示在页面上-->
|
||||
<div class="router-container">
|
||||
<div class="route-link" :class="{'active':item.name === $route.meta.activeSecondMenuName}" v-for="(item,index) in childrenRoute" :key="index+'dzjkChildrenRoute'">
|
||||
@ -42,6 +42,12 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeRouteLeave(to,from, next){
|
||||
//从单站监控下面的所有子页面跳出时会触发
|
||||
// 清空store中的zdList 保障下次进入到单站监控会重新调用接口获取数据
|
||||
this.$store.commit('SET_ZD_LIST',[])
|
||||
next()
|
||||
},
|
||||
mounted() {
|
||||
console.log('单站监控一级页面路由',this.$route)
|
||||
}
|
||||
|
Reference in New Issue
Block a user