diff --git a/packages/nc-gui-v2/components/tabs/Auth.vue b/packages/nc-gui-v2/components/tabs/Auth.vue index 0a467a52f4..4c5c0cd80b 100644 --- a/packages/nc-gui-v2/components/tabs/Auth.vue +++ b/packages/nc-gui-v2/components/tabs/Auth.vue @@ -2,39 +2,39 @@ import UserManagement from './auth/UserManagement.vue' import ApiTokenManagement from './auth/ApiTokenManagement.vue' -interface TabGroup { - [key: string]: { - title: string - body: any - } +interface Tab { + title: string + body: any } -const tabsInfo: TabGroup = { - usersManagement: { +const tabsInfo: Tab[] = [ + { title: 'Users Management', body: () => UserManagement, }, - apiTokenManagement: { + { title: 'API Token Management', body: () => ApiTokenManagement, }, -} +] -const firstKeyOfObject = (obj: object) => Object.keys(obj)[0] +// const firstKeyOfObject = (obj: object) => Object.keys(obj)[0] -const selectedTabKeys = $ref([firstKeyOfObject(tabsInfo)]) -const selectedTab = $computed(() => tabsInfo[selectedTabKeys[0]]) +const selectedTabKey = $ref(0) +const selectedTab = $computed(() => tabsInfo[selectedTabKey])