import { useState } from '#app' export interface TabItem { type: 'table' | 'view' title: string id: string } export default () => { const tabs = useState>('tabs', () => []) const activeTab = useState('activeTab', () => 0) const addTab = (tabMeta: TabItem) => { tabs.value = [...(tabs.value || []), tabMeta] activeTab.value = tabs.value.length - 1 } const clearTabs = () => { tabs.value = [] } return { tabs, addTab, activeTab, clearTabs } }