perf: 完善useTagsView
This commit is contained in:
@@ -3,10 +3,15 @@ import { ContentWrap } from '@/components/ContentWrap'
|
||||
import { ElInput } from 'element-plus'
|
||||
import { ref } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTagsView } from '@/hooks/web/useTagsView'
|
||||
|
||||
const { setTitle } = useTagsView()
|
||||
|
||||
const { params } = useRoute()
|
||||
|
||||
const val = ref(params.id as string)
|
||||
|
||||
setTitle(`详情页-${val.value}`)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -6,7 +6,8 @@ import { useRouter } from 'vue-router'
|
||||
|
||||
const { push } = useRouter()
|
||||
|
||||
const { closeAll, closeLeft, closeRight, closeOther, closeCurrent, refreshPage } = useTagsView()
|
||||
const { closeAll, closeLeft, closeRight, closeOther, closeCurrent, refreshPage, setTitle } =
|
||||
useTagsView()
|
||||
|
||||
const closeAllTabs = () => {
|
||||
closeAll(() => {
|
||||
@@ -35,6 +36,10 @@ const closeCurrentTab = () => {
|
||||
push('/dashboard/analysis')
|
||||
})
|
||||
}
|
||||
|
||||
const setTabTitle = () => {
|
||||
setTitle(new Date().getTime().toString())
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -45,6 +50,6 @@ const closeCurrentTab = () => {
|
||||
<ElButton @click="closeOtherTabs"> 关闭其他标签页 </ElButton>
|
||||
<ElButton @click="closeCurrentTab"> 关闭当前标签页 </ElButton>
|
||||
<ElButton @click="refresh"> 刷新当前标签页 </ElButton>
|
||||
<ElButton @click="setTabTitle"> 修改当前标题 </ElButton>
|
||||
</ContentWrap>
|
||||
</template>
|
||||
@/hooks/web/useTagsView
|
||||
|
||||
Reference in New Issue
Block a user