- vue.2.0 (webpack)打包配置
vue.config.js module.exports = { publicPath: './', }
onst router = new VueRouter({ mode: 'history', 把history改为hash base: process.env.BASE_URL, routes })
rout文件
export default router - vue3.0 (webpack)打包配置
vue.config.js module.exports = { publicPath: './', } rout文件 const router = createRouter({ history:createWebHashHistory(process.env.BASE_URL), 修改为createWebHistory(process.env.BASE_URL), routes })
- react(vite)打包配置
package.json 增加 { "homepage": "./", }