fix: Tab切换导航失效

This commit is contained in:
ZiuChen 2022-08-16 12:23:41 +08:00
parent 4a48da9612
commit 35d0723436

View File

@ -88,6 +88,7 @@ const ClipSwitchRef = ref()
onMounted(() => { onMounted(() => {
// Ref // Ref
const activeTab = computed(() => ClipSwitchRef.value.activeTab) const activeTab = computed(() => ClipSwitchRef.value.activeTab)
const toggleNav = ClipSwitchRef.value.toggleNav
// //
list.value = window.db.dataBase.data list.value = window.db.dataBase.data
@ -141,7 +142,8 @@ onMounted(() => {
const list = ['all', 'text', 'image', 'file'] const list = ['all', 'text', 'image', 'file']
const index = list.indexOf(activeTab.value) const index = list.indexOf(activeTab.value)
const target = index === list.length - 1 ? list[0] : list[index + 1] const target = index === list.length - 1 ? list[0] : list[index + 1]
updateShowList(target) toggleNav(target)
updateShowList(activeTab.value)
} else if (isSearch) { } else if (isSearch) {
window.focus() window.focus()
} else if (isExit) { } else if (isExit) {