1.:使用vue-cli3创建vue应用
2.:因为vue-cli3创建应用时不会自动生成vue.config.js所以这里需要手动创建,在项目更目录创建vue.config.js文件
3.:加入多配置代码
module.exports = {
pages: {
index: {
// 页面的入口
entry: './src/pages/index/main.js',
// 页面的模板
template: './public/index.html',
// build时输出的文件名
filename: 'index.html',
// 当使用 title 选项时,
// template 中的 title 标签需要是 <title><%= htmlWebpackPlugin.options.title %></title>
title: '标题1',
// 在这个页面中包含的块,默认情况下会包含
},
// 对course页面的配置
course: {
entry: './src/pages/course/main.js',
template: './public/course.html',
filename: 'course.html',
title: '标题2',
}
},
}
4.在public下创建相关index.html和course.html文件
5.创建不同项目的app.js main.js
6.完成多项目配置访问localhost:8080/#/index.html 页面1 localhost:8080/#/course.html 页面2











网友评论