|
|
@ -1,5 +1,5 @@
|
|
|
|
import { defineComponent, h } from 'vue'
|
|
|
|
import { defineComponent, h } from 'vue'
|
|
|
|
import { useRoute } from '../router'
|
|
|
|
import { useData, useRoute } from 'vitepress'
|
|
|
|
import { contentUpdatedCallbacks } from '../utils'
|
|
|
|
import { contentUpdatedCallbacks } from '../utils'
|
|
|
|
|
|
|
|
|
|
|
|
const runCbs = () => contentUpdatedCallbacks.forEach((fn) => fn())
|
|
|
|
const runCbs = () => contentUpdatedCallbacks.forEach((fn) => fn())
|
|
|
@ -11,14 +11,19 @@ export const Content = defineComponent({
|
|
|
|
},
|
|
|
|
},
|
|
|
|
setup(props) {
|
|
|
|
setup(props) {
|
|
|
|
const route = useRoute()
|
|
|
|
const route = useRoute()
|
|
|
|
|
|
|
|
const { site } = useData()
|
|
|
|
return () =>
|
|
|
|
return () =>
|
|
|
|
h(props.as, { style: { position: 'relative' } }, [
|
|
|
|
h(
|
|
|
|
|
|
|
|
props.as,
|
|
|
|
|
|
|
|
site.value.contentProps ?? { style: { position: 'relative' } },
|
|
|
|
|
|
|
|
[
|
|
|
|
route.component
|
|
|
|
route.component
|
|
|
|
? h(route.component, {
|
|
|
|
? h(route.component, {
|
|
|
|
onVnodeMounted: runCbs,
|
|
|
|
onVnodeMounted: runCbs,
|
|
|
|
onVnodeUpdated: runCbs
|
|
|
|
onVnodeUpdated: runCbs
|
|
|
|
})
|
|
|
|
})
|
|
|
|
: '404 Page Not Found'
|
|
|
|
: '404 Page Not Found'
|
|
|
|
])
|
|
|
|
]
|
|
|
|
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|