@zenghj/v-prefetch
v0.0.1
Published
a vue directive for prefetch some resources
Downloads
3
Readme
v-prefetch
Prefetch dynamic imported route components when the route link target gets into the viewport.
usage
import Vue from 'vue'
import VPrefetch from 'v-prefetch'
import router from './router'
Vue.directive(VPrefetch.name, VPrefetch.getInstance({router}))
<!-- SomeComponent组件进入视口时开始预加载“/about”路由组件 -->
<SomeComponent v-prefetch="{
to: '/about'
}"
></SomeComponent>
There is an example