步骤1
在src的同级目录下创建一个vue.config.js文件
module.exports = {
publicPath: './',
outputDir: 'dist',
assetsDir: 'static'
}
步骤2
在router的index.js的const router = new VueRouter({...})代码块中,如果存在mode: 'history'的模式设定,则需要将此设定注释掉(或删掉)。
步骤3
再执行npm run build命令,得到的资源文件夹即可正常在浏览器中显示其内容。