Browse Source

chore(gui-v2): correct tab item type and export enum

pull/2837/head
braks 2 years ago
parent
commit
e61dfe31fb
  1. 6
      packages/nc-gui-v2/components/smartsheet/Sidebar.vue
  2. 2
      packages/nc-gui-v2/composables/useTabs.ts

6
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)

2
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',

Loading…
Cancel
Save