Skip to content

Commit 254e15b

Browse files
authored
feat(theme): add as prop to Content (#2011)
1 parent caa9bf6 commit 254e15b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/client/app/components/Content.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ import { useRoute } from '../router.js'
44
export const Content = defineComponent({
55
name: 'VitePressContent',
66
props: {
7-
onContentUpdated: Function
7+
onContentUpdated: Function,
8+
as: { type: [Object, String], default: 'div' }
89
},
910
setup(props) {
1011
const route = useRoute()
1112
onUpdated(() => {
1213
props.onContentUpdated?.()
1314
})
1415
return () =>
15-
h('div', { style: { position: 'relative' } }, [
16+
h(props.as, { style: { position: 'relative' } }, [
1617
route.component ? h(route.component) : null
1718
])
1819
}

0 commit comments

Comments
 (0)