diff --git a/packages/nc-gui-v2/components/smartsheet/Sidebar.vue b/packages/nc-gui-v2/components/smartsheet/Sidebar.vue index bf2c62e5af..0364d8c85f 100644 --- a/packages/nc-gui-v2/components/smartsheet/Sidebar.vue +++ b/packages/nc-gui-v2/components/smartsheet/Sidebar.vue @@ -23,6 +23,8 @@ import MdiContentCopy from '~icons/mdi/content-copy' import MdiXml from '~icons/mdi/xml' import MdiHook from '~icons/mdi/hook' import MdiHeartsCard from '~icons/mdi/cards-heart' +import type { TabItem } from '~/composables/useTabs' +import { TabType } from '~/composables/useTabs' const meta = inject(MetaInj, ref()) @@ -102,10 +104,10 @@ function onCreate(view: GridType | FormType | KanbanType | GalleryType) { function changeView(view: { id: string; alias?: string; title?: string; type: ViewTypes }) { activeView.value = view - const tabProps = { + const tabProps: TabItem = { id: view.id, title: (view.alias ?? view.title) || '', - type: ViewTypes[view.type], + type: TabType.VIEW, } addTab(tabProps) diff --git a/packages/nc-gui-v2/composables/useTabs.ts b/packages/nc-gui-v2/composables/useTabs.ts index 2ef34dbac5..ee5351995c 100644 --- a/packages/nc-gui-v2/composables/useTabs.ts +++ b/packages/nc-gui-v2/composables/useTabs.ts @@ -2,7 +2,7 @@ import type { WritableComputedRef } from '@vue/reactivity' import { useState } from '#app' import useProject from '~/composables/useProject' -enum TabType { +export enum TabType { TABLE = 'table', VIEW = 'view', AUTH = 'auth',