docs/.vitepress/theme/components/tabs/index.ts

9c6588973e856dbc27ebb283f0d963c792faa8df
wotaku/docs/.vitepress/theme/components/tabs/index.ts history · blame · raw

17 lines · 471 bytes

 1import type { App } from 'vue'
 2import PluginTabs from './PluginTabs.vue'
 3import PluginTabsTab from './PluginTabsTab.vue'
 4import { provideTabsSharedState } from './state'
 5
 6export interface EnhanceTabsOptions {
 7  renderAll?: boolean
 8}
 9
10export function enhanceAppWithTabs(
11  app: App,
12  options: EnhanceTabsOptions = {}
13) {
14  provideTabsSharedState(app, Boolean(options.renderAll))
15  app.component('PluginTabs', PluginTabs)
16  app.component('PluginTabsTab', PluginTabsTab)
17}