Browse Source

fix: preserve tabs

pull/9585/head
DarkPhoenix2704 2 months ago
parent
commit
1a138e9020
  1. 12
      packages/nc-gui/components/feed/View.vue

12
packages/nc-gui/components/feed/View.vue

@ -48,14 +48,14 @@ const tabs: Array<{
const router = useRouter()
const updateTab = (key: string) => {
$e(`c:nocodb:feed, tab:${key}`)
router.push({ query: { tab: key } })
}
watch(activeTab, (val) => {
$e(`c:nocodb:feed, tab:${val}`)
router.push({ query: { tab: val } })
})
onMounted(() => {
const tab = router.currentRoute.value.query.tab as string
if (tab) {
if (tab && tabs.some((t) => t.key === tab)) {
activeTab.value = tab
}
})
@ -68,7 +68,7 @@ onMounted(() => {
<NcTabs v-model:activeKey="activeTab" centered>
<a-tab-pane v-for="tab in tabs" :key="tab.key" class="bg-gray-50 !h-full">
<template #tab>
<div class="flex gap-2 items-center" @click="updateTab(tab.key)">
<div class="flex gap-2 items-center">
<GeneralIcon
:class="{
'text-brand-500': activeTab === tab.key,

Loading…
Cancel
Save