解决方法一:
在路由配置router文件夹--index.js文件中新增2句代码,jsc为你所需要配置的二级目录名:
const router = new VueRouter({
mode: 'history',
base: '/jsc/', // 这是二级路径
routes
})
解决方法二:
在vue.config.js中新增2句代码:
const BASE_URL = process.env.NODE_ENV === 'production' ? '/jsc' : ''
module.exports = {
publicPath: BASE_URL
}