Skip to content

Commit

Permalink
feat(theme): add as prop to Content (#2011)
Browse files Browse the repository at this point in the history
  • Loading branch information
rgk committed Mar 1, 2023
1 parent caa9bf6 commit 254e15b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/client/app/components/Content.ts
Expand Up @@ -4,15 +4,16 @@ import { useRoute } from '../router.js'
export const Content = defineComponent({
name: 'VitePressContent',
props: {
onContentUpdated: Function
onContentUpdated: Function,
as: { type: [Object, String], default: 'div' }
},
setup(props) {
const route = useRoute()
onUpdated(() => {
props.onContentUpdated?.()
})
return () =>
h('div', { style: { position: 'relative' } }, [
h(props.as, { style: { position: 'relative' } }, [
route.component ? h(route.component) : null
])
}
Expand Down

0 comments on commit 254e15b

Please sign in to comment.