|
@@ -94,7 +94,7 @@ const removeTab = (name: TabPaneName) => {
|
|
watch(
|
|
watch(
|
|
() => route.name,
|
|
() => route.name,
|
|
to => {
|
|
to => {
|
|
- setTab(routeToTab(to))
|
|
|
|
|
|
+ setTab(routeToTab(router.getRoutes()?.find(item => item.name === to)))
|
|
},
|
|
},
|
|
{
|
|
{
|
|
deep: true
|
|
deep: true
|
|
@@ -173,13 +173,19 @@ const refresh = () => {
|
|
<el-tabs
|
|
<el-tabs
|
|
v-model="activeValue"
|
|
v-model="activeValue"
|
|
type="card"
|
|
type="card"
|
|
- closable
|
|
|
|
@tab-change="changeTab"
|
|
@tab-change="changeTab"
|
|
@tab-remove="removeTab"
|
|
@tab-remove="removeTab"
|
|
@contextmenu.prevent="openContextMenu($event)"
|
|
@contextmenu.prevent="openContextMenu($event)"
|
|
@dblclick="refresh"
|
|
@dblclick="refresh"
|
|
>
|
|
>
|
|
- <el-tab-pane v-for="item in tabs" :key="item.name" :label="item.title" :name="item.fullPath" :tab="item">
|
|
|
|
|
|
+ <el-tab-pane
|
|
|
|
+ v-for="item in tabs"
|
|
|
|
+ :key="item.name"
|
|
|
|
+ :label="item.title"
|
|
|
|
+ :name="item.fullPath"
|
|
|
|
+ :tab="item"
|
|
|
|
+ :closable="item.name !== config.homeRouteName"
|
|
|
|
+ >
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
</el-tabs>
|
|
</el-tabs>
|
|
|
|
|