Skip to content

Commit

Permalink
register vue component globally
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarusA committed Apr 3, 2024
1 parent 1dcad35 commit 1744bc7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
5 changes: 3 additions & 2 deletions docs/src/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ export default {
extends: DefaultTheme,
Layout() {
return h(DefaultTheme.Layout, null, {
// 'home-hero-info-after': () => h(HomeTrustees),
'aside-ads-before': () => h(AsideTrustees),
})
},
enhanceApp({ app, router, siteData }) {
enhanceApp({ app }) {
enhanceAppWithTabs(app)
// register your custom global components
app.component('AsideTrustees')
}
} satisfies Theme
8 changes: 1 addition & 7 deletions template/src/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// .vitepress/theme/index.ts
import { h } from 'vue'
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'

Expand All @@ -8,12 +7,7 @@ import './style.css'

export default {
extends: DefaultTheme,
Layout() {
return h(DefaultTheme.Layout, null, {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
})
},
enhanceApp({ app, router, siteData }) {
enhanceApp({ app }) {
enhanceAppWithTabs(app)
}
} satisfies Theme

0 comments on commit 1744bc7

Please sign in to comment.