mirror of https://github.com/vuejs/vitepress
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.
15 lines
408 B
15 lines
408 B
import { h } from 'vue'
|
|
import { useRoute } from '../router'
|
|
import { usePrefetch } from '../composables/preFetch'
|
|
|
|
export const Content = {
|
|
setup() {
|
|
const route = useRoute()
|
|
if (process.env.NODE_ENV === 'production') {
|
|
// in prod mode, enable intersectionObserver based pre-fetch.
|
|
usePrefetch()
|
|
}
|
|
return () => (route.contentComponent ? h(route.contentComponent) : null)
|
|
}
|
|
}
|