|
|
@ -87,17 +87,7 @@ const selectedTabKeys = $ref<string[]>([firstKeyOfObject(tabsInfo)]) |
|
|
|
const selectedTab = $computed(() => tabsInfo[selectedTabKeys[0]]) |
|
|
|
const selectedTab = $computed(() => tabsInfo[selectedTabKeys[0]]) |
|
|
|
|
|
|
|
|
|
|
|
let selectedSubTabKeys = $ref<string[]>([firstKeyOfObject(selectedTab.subTabs)]) |
|
|
|
let selectedSubTabKeys = $ref<string[]>([firstKeyOfObject(selectedTab.subTabs)]) |
|
|
|
const selectedSubTab = $computed(() => { |
|
|
|
const selectedSubTab = $computed(() => selectedTab.subTabs[selectedSubTabKeys[0]]) |
|
|
|
const isSubTabInSelectedTab = (subTab: any) => subTab in selectedTab.subTabs |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Select the first subtab |
|
|
|
|
|
|
|
const currentlySelectedSubTabKey = selectedSubTabKeys[0] |
|
|
|
|
|
|
|
const subTabKey = isSubTabInSelectedTab(currentlySelectedSubTabKey) |
|
|
|
|
|
|
|
? currentlySelectedSubTabKey |
|
|
|
|
|
|
|
: firstKeyOfObject(selectedTab.subTabs) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return selectedTab.subTabs[subTabKey] |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
watch( |
|
|
|
() => selectedTabKeys[0], |
|
|
|
() => selectedTabKeys[0], |
|
|
|