vue实现多入口配置方法
1、在src下创建多个包
2、把原有的main.js和app.vue删除,在各个子包下创建自己单独的main.js和app.vue,子包里的main.js和app.vue格式一致,内容根据自己需要添加
3、在public里建立对应的index2.html模板文件,内容与index.html一致,根据需求自己需改。
4、在vue.config.js里加入配置
5、在主包下router里加入
{
path:"/index1/index",//首页路径
name:"index1",
beforeEnter(to,from,next){
window.location="/index1.html"
}
}