菜单栏增加单页面刷新功能
1.移除带参路由来回切换data 2.只刷新当前router,不影响其他已缓存的router
This commit is contained in:
@@ -27,6 +27,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="d2-multiple-page-control-btn" flex-box="0">
|
||||
<el-button @click="handleRefresh">
|
||||
<d2-icon name="refresh"/>
|
||||
</el-button>
|
||||
<el-dropdown
|
||||
size="default"
|
||||
split-button
|
||||
@@ -97,6 +100,14 @@ export default {
|
||||
'closeAll',
|
||||
'openedSort'
|
||||
]),
|
||||
/**
|
||||
* @description 仅刷新当前router组件 不影响其他已缓存的组件
|
||||
*/
|
||||
handleRefresh () {
|
||||
this.$router.push({
|
||||
name: 'refresh'
|
||||
})
|
||||
},
|
||||
/**
|
||||
* @description 计算某个标签页是否可关闭
|
||||
* @param {Object} page 其中一个标签页
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<div class="d2-theme-container-main-body" flex-box="1">
|
||||
<transition :name="transitionActive ? 'fade-transverse' : ''">
|
||||
<keep-alive :include="keepAlive">
|
||||
<router-view/>
|
||||
<router-view :key="$route.path + $route.meta[$route.path]" />
|
||||
</keep-alive>
|
||||
</transition>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user