const getMobile = name => () =>
import (`../mobile/${name}.vue`)
这个方法是放在router/index.js里面
当我们再次去写路由的时候就可以直接写mobile下的文件
{path: '/Tabbar', name: 'Tabbar', component: getMobile('tabbar/Tabbar')},
const getMobile = name => () =>
import (`../mobile/${name}.vue`)
这个方法是放在router/index.js里面
当我们再次去写路由的时候就可以直接写mobile下的文件
{path: '/Tabbar', name: 'Tabbar', component: getMobile('tabbar/Tabbar')},
本文标题:带你快速理解路由懒加载
本文链接:https://www.haomeiwen.com/subject/nnfpbhtx.html
网友评论