forked from liweijie/education
点击标题关闭所有tab
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
class="mobile-hamburger"
|
class="mobile-hamburger"
|
||||||
@toggleClick="toggleSideBar"
|
@toggleClick="toggleSideBar"
|
||||||
/>
|
/>
|
||||||
<span class="sys-title">教学管理信息系统</span>
|
<span class="sys-title" title="关闭所有已打开的页签" @click="handleCloseAllTabs">教学管理信息系统</span>
|
||||||
</div>
|
</div>
|
||||||
<semester-bar class="top-header__center" />
|
<semester-bar class="top-header__center" />
|
||||||
<navbar class="top-header__right" :header-mode="true" />
|
<navbar class="top-header__right" :header-mode="true" />
|
||||||
@@ -69,6 +69,16 @@ export default {
|
|||||||
},
|
},
|
||||||
toggleSideBar() {
|
toggleSideBar() {
|
||||||
this.$store.dispatch('app/toggleSideBar')
|
this.$store.dispatch('app/toggleSideBar')
|
||||||
|
},
|
||||||
|
handleCloseAllTabs() {
|
||||||
|
this.$store.dispatch('tagsView/delAllViews').then(({ visitedViews }) => {
|
||||||
|
const last = visitedViews[visitedViews.length - 1]
|
||||||
|
if (last) {
|
||||||
|
this.$router.push(last.fullPath).catch(() => {})
|
||||||
|
} else {
|
||||||
|
this.$router.push('/').catch(() => {})
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -129,6 +139,14 @@ export default {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
letter-spacing: 1.5px;
|
letter-spacing: 1.5px;
|
||||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
|
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 4px 10px;
|
||||||
|
transition: background 0.25s ease;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: rgba(255, 255, 255, 0.15);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user