在index.js中 将
const router = createRouter({ history: createWebHistory(), routes
});
改成
const router = createRouter({ history: createWebHashHistory(), routes
});
(导入记得改)
import { createRouter, createWebHashHistory } from ‘vue-router’;
即可 这样 url 就会在路径中 多出一个#
类似:192.168.0.88:8099/#/
这样跳转刷新的时候就不会有问题了