Vue.js中能使用vue-router + webpack 实现懒加载吗
1个回答
展开全部
可以,vue中提供了路由懒加载的方法,
const Proofread = (resolve) => {
import('components/proofread/proofread').then((module) => {
resolve(module)
})
}
Proofread 为组件名
'components/proofread/proofread'为路径
这些代码相当于普通加载的
impor Proofread from 'components/proofread/proofread'
const Proofread = (resolve) => {
import('components/proofread/proofread').then((module) => {
resolve(module)
})
}
Proofread 为组件名
'components/proofread/proofread'为路径
这些代码相当于普通加载的
impor Proofread from 'components/proofread/proofread'
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询