mirror of https://github.com/vuejs/vitepress
parent
b8e892e94a
commit
8dea5185f0
@ -1,16 +1,10 @@
|
|||||||
import { h } from 'vue'
|
import { h } from 'vue'
|
||||||
import { useRoute } from '../router'
|
import { useRoute } from '../router'
|
||||||
import { usePrefetch } from '../composables/preFetch'
|
|
||||||
|
|
||||||
export const Content = {
|
export const Content = {
|
||||||
|
name: 'VitePressContent',
|
||||||
setup() {
|
setup() {
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
if (import.meta.env.PROD) {
|
|
||||||
// in prod mode, enable intersectionObserver based pre-fetch
|
|
||||||
usePrefetch()
|
|
||||||
}
|
|
||||||
|
|
||||||
return () => (route.component ? h(route.component) : null)
|
return () => (route.component ? h(route.component) : null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue