我使用vue.config.js方法创建了一个多页面应用程序,没有遇到任何问题。我创建了一个生产构建,我可以访问主页,但我无法访问其他页面,例如关于我们、作品集等。
可能出现了什么问题?如何解决?是.htaccess的问题吗?
以下是我的vue.config.js代码:
这是我的文件结构
生产文件
可能出现了什么问题?如何解决?是.htaccess的问题吗?
以下是我的vue.config.js代码:
module.exports = {
pages: {
index: {
entry: './src/pages/Home/main.js',
template: 'public/index.html',
title: 'Welcome to Appclust',
chunks: ['chunk-vendors', 'chunk-common', 'index']
},
about:{
entry: './src/pages/About/main.js',
template: 'public/index.html',
title: 'About us',
chunks: ['chunk-vendors', 'chunk-common', 'about']
},
portfolio:{
entry: './src/pages/Portfolio/main.js',
template: 'public/index.html',
title: 'Portfolio',
chunks: ['chunk-vendors', 'chunk-common', 'portfolio']
},
testimonials:{
entry: './src/pages/Testimonials/main.js',
template: 'public/index.html',
title: 'Testimonials',
chunks: ['chunk-vendors', 'chunk-common', 'testimonials ']
},
careers:{
entry: './src/pages/Careers/main.js',
template: 'public/index.html',
title: 'Careers',
chunks: ['chunk-vendors', 'chunk-common', 'careers']
},
contact:{
entry: './src/pages/Contact/main.js',
template: 'public/index.html',
title: 'Contact',
chunks: ['chunk-vendors', 'chunk-common', 'contact']
}
}
}
这是我的文件结构
![在此输入图像描述](https://istack.dev59.com/d2r6v.webp)