feat: 新增useTagsView
This commit is contained in:
50
src/views/hooks/useTagsView.vue
Normal file
50
src/views/hooks/useTagsView.vue
Normal file
@@ -0,0 +1,50 @@
|
||||
<script setup lang="ts">
|
||||
import { ContentWrap } from '@/components/ContentWrap'
|
||||
import { ElButton } from 'element-plus'
|
||||
import { useTagsView } from '@/hooks/web/useTagsView'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
const { push } = useRouter()
|
||||
|
||||
const { closeAll, closeLeft, closeRight, closeOther, closeCurrent, refreshPage } = useTagsView()
|
||||
|
||||
const closeAllTabs = () => {
|
||||
closeAll(() => {
|
||||
push('/dashboard/analysis')
|
||||
})
|
||||
}
|
||||
|
||||
const closeLeftTabs = () => {
|
||||
closeLeft()
|
||||
}
|
||||
|
||||
const closeRightTabs = () => {
|
||||
closeRight()
|
||||
}
|
||||
|
||||
const closeOtherTabs = () => {
|
||||
closeOther()
|
||||
}
|
||||
|
||||
const refresh = () => {
|
||||
refreshPage()
|
||||
}
|
||||
|
||||
const closeCurrentTab = () => {
|
||||
closeCurrent(undefined, () => {
|
||||
push('/dashboard/analysis')
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ContentWrap title="useTagsView">
|
||||
<ElButton @click="closeAllTabs"> 关闭所有标签页 </ElButton>
|
||||
<ElButton @click="closeLeftTabs"> 关闭左侧标签页 </ElButton>
|
||||
<ElButton @click="closeRightTabs"> 关闭右侧标签页 </ElButton>
|
||||
<ElButton @click="closeOtherTabs"> 关闭其他标签页 </ElButton>
|
||||
<ElButton @click="closeCurrentTab"> 关闭当前标签页 </ElButton>
|
||||
<ElButton @click="refresh"> 刷新当前标签页 </ElButton>
|
||||
</ContentWrap>
|
||||
</template>
|
||||
@/hooks/web/useTagsView
|
||||
Reference in New Issue
Block a user