//index.js 里 不要过早import引入 在component 属性 函数方式临时引入
//懒加载
{
path: '/about',
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
}
// 脚手架根目录 创建vue.config.js
//彻底懒加载
module.exports = {
chainWebpack: config => {
config.plugins.delete("prefetch")
//删除index.html带有prefetch属性的link,不要异步下载暂时不需要的页面组件文件
}
}
//http-proxy代理跨域
devServer:{
Proxy:{
'/':{
target:`公用地址`,
changeOrigin:true
}
}
}