Vue3打包出现空白页及路由错误的解决方法

205 阅读1分钟

1.在根目录下修改/创建 vue.config.js 文件,写入

module.exports = {
    publicPath: './',
}

2.路由使用hash模式 router的index.js

const router=createRouter({
    history:createWebHashHistory(),
    routes
})

说明: