在 Vue 多页面应用中,可以使用 vue.config.js 文件来配置项目运行时的行为,其中可以配置打开的页面。
首先,在项目根目录下创建 vue.config.js 文件,在该文件中添加如下代码:
module.exports = {
pages: {
index: {
entry:'src/pages/index/main.js',
template: 'public/index.html',
filename: 'index.html'
},