fix: avoid circular deps when extending default theme + importing feature components

fix #1210
pull/1224/head
Evan You 2 years ago
parent bfb0220989
commit 5fb794864b

@ -55,6 +55,9 @@ export function createApp() {
const data = initData(router.route)
app.provide(dataSymbol, data)
// provide this to avoid circular dependency in VPContent
app.provide('NotFound', NotFound)
// install global components
app.component('Content', Content)
app.component('ClientOnly', ClientOnly)

@ -2,16 +2,16 @@
import { useRoute, useData } from 'vitepress'
import { useCopyCode } from '../composables/copy-code.js'
import { useSidebar } from '../composables/sidebar.js'
import Theme from '@theme/index'
import VPPage from './VPPage.vue'
import VPHome from './VPHome.vue'
import VPDoc from './VPDoc.vue'
import { inject } from 'vue'
const route = useRoute()
const { frontmatter } = useData()
const { hasSidebar } = useSidebar()
const NotFound = Theme.NotFound || (() => '404 Not Found')
const NotFound = inject('NotFound')
useCopyCode()
</script>

Loading…
Cancel
Save