|
|
@ -4,7 +4,8 @@ import { useRoute } from '../router.js'
|
|
|
|
export const Content = defineComponent({
|
|
|
|
export const Content = defineComponent({
|
|
|
|
name: 'VitePressContent',
|
|
|
|
name: 'VitePressContent',
|
|
|
|
props: {
|
|
|
|
props: {
|
|
|
|
onContentUpdated: Function
|
|
|
|
onContentUpdated: Function,
|
|
|
|
|
|
|
|
as: { type: [Object, String], default: 'div' }
|
|
|
|
},
|
|
|
|
},
|
|
|
|
setup(props) {
|
|
|
|
setup(props) {
|
|
|
|
const route = useRoute()
|
|
|
|
const route = useRoute()
|
|
|
@ -12,7 +13,7 @@ export const Content = defineComponent({
|
|
|
|
props.onContentUpdated?.()
|
|
|
|
props.onContentUpdated?.()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
return () =>
|
|
|
|
return () =>
|
|
|
|
h('div', { style: { position: 'relative' } }, [
|
|
|
|
h(props.as, { style: { position: 'relative' } }, [
|
|
|
|
route.component ? h(route.component) : null
|
|
|
|
route.component ? h(route.component) : null
|
|
|
|
])
|
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|