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