提交 a0ef747f 编写于 作者: Mr.奇淼('s avatar Mr.奇淼(

Merge branches 'gva-vue3-2.4.5' and 'master' of...

Merge branches 'gva-vue3-2.4.5' and 'master' of github.com:flipped-aurora/gin-vue-admin into gva-vue3-2.4.5
...@@ -16,9 +16,7 @@ ...@@ -16,9 +16,7 @@
:tab="item" :tab="item"
class="gva-tab" class="gva-tab"
> >
<template #label> <span slot="label" :style="{color: activeValue===name(item)?activeColor:'#333'}"><i class="dot" :style="{ backgroundColor:activeValue===name(item)?activeColor:'#ddd'}" /> {{ item.meta.title }}</span>
<span :style="{color: activeValue===name(item)?activeColor:'#333'}"><i class="dot" :style="{backgroundColor:activeValue===name(item)?activeColor:'#ddd'}" /> {{ item.meta.title }}</span>
</template>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
...@@ -109,7 +107,13 @@ export default { ...@@ -109,7 +107,13 @@ export default {
} }
this.setTab(this.$route) this.setTab(this.$route)
}, },
mounted(){
//全局监听 关闭当前页面函数
this.$bus.on('closeThisPage', ()=>{
const router = this.$route.path.split("/")
this.removeTab(`${router[router.length - 1]}`)
})
},
beforeDestroy() { beforeDestroy() {
emitter.off('collapse') emitter.off('collapse')
emitter.off('mobile') emitter.off('mobile')
...@@ -247,6 +251,7 @@ export default { ...@@ -247,6 +251,7 @@ export default {
}) })
}, },
removeTab(tab) { removeTab(tab) {
console.log(tab)
const index = this.historys.findIndex( const index = this.historys.findIndex(
item => getFmtString(item) === tab item => getFmtString(item) === tab
) )
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<!-- 当前面包屑用路由自动生成可根据需求修改 --> <!-- 当前面包屑用路由自动生成可根据需求修改 -->
<!-- <!--
:to="{ path: item.path }" 暂时注释不用--> :to="{ path: item.path }" 暂时注释不用-->
<HistoryComponent /> <HistoryComponent ref="layoutHistoryComponent" />
</div> </div>
</transition> </transition>
<router-view v-if="$route.meta.keepAlive && reloadFlag" v-slot="{ Component }" v-loading="loadingFlag" element-loading-text="正在加载中" class="admin-box"> <router-view v-if="$route.meta.keepAlive && reloadFlag" v-slot="{ Component }" v-loading="loadingFlag" element-loading-text="正在加载中" class="admin-box">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册