You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
vitepress/src/client/app/components/Content.ts

20 lines
456 B

import { defineComponent, h, onUpdated } from 'vue'
import { useRoute } from '../router.js'
export const Content = defineComponent({
name: 'VitePressContent',
props: {
onContentUpdated: Function
},
setup(props) {
const route = useRoute()
onUpdated(() => {
props.onContentUpdated?.()
})
return () =>
h('div', { style: { position: 'relative' } }, [
route.component ? h(route.component) : null
])
}
})