vue3x多页面运行默认打开其中的某一页面vueconfigjs中怎么配置
可以在vue.config.js中的pages配置中添加一个entry属性来指定默认打开的页面。例如:
module.exports = {
pages: {
index: {
entry: 'src/pages/index/main.js',
template: 'public/index.html',
filename: 'index.html'
},
about: {
entry: 'src/pages/about/main.js',
template: 'public/about.html',
filename: 'about.html'
}
},
devServer: {
open: 'about' // 默认打开about.html页面
}
}
在devServer配置中,使用open属性来指定默认打开的页面,如上例中就是默认打开about.html页面。
原文地址: http://www.cveoy.top/t/topic/d9Us 著作权归作者所有。请勿转载和采集!