|
|
@ -16,7 +16,7 @@ |
|
|
|
:tab="item" |
|
|
|
class="gva-tab" |
|
|
|
> |
|
|
|
<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 slot="label" :style="{color: activeValue===name(item)?activeColor:'#333'}"><i class="dot" :style="{ backgroundColor:activeValue===name(item)?activeColor:'#ddd'}" /> {{ item.meta.title }}</span> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
|
|
|
@ -105,7 +105,13 @@ export default { |
|
|
|
} |
|
|
|
this.setTab(this.$route) |
|
|
|
}, |
|
|
|
|
|
|
|
mounted(){ |
|
|
|
//全局监听 关闭当前页面函数 |
|
|
|
this.$bus.on('closeThisPage', ()=>{ |
|
|
|
const router = this.$route.path.split("/") |
|
|
|
this.removeTab(`${router[router.length - 1]}`) |
|
|
|
}) |
|
|
|
}, |
|
|
|
beforeDestroy() { |
|
|
|
this.$bus.off('collapse') |
|
|
|
this.$bus.off('mobile') |
|
|
@ -244,6 +250,7 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
removeTab(tab) { |
|
|
|
console.log(tab) |
|
|
|
const index = this.historys.findIndex( |
|
|
|
item => getFmtString(item) === tab |
|
|
|
) |
|
|
|