mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-14 09:38:13 +08:00
🐛 路由跳转优化
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @file router index.ts
|
||||
* @description 路由入口
|
||||
* @author BTMuli<bt-muli@outlook.com>
|
||||
* @since Alpha v0.1.2
|
||||
* @since Beta v0.3.2
|
||||
*/
|
||||
|
||||
import { createRouter, createWebHistory } from "vue-router";
|
||||
@@ -13,4 +13,12 @@ const router = createRouter({
|
||||
routes,
|
||||
});
|
||||
|
||||
// 解决路由重复问题
|
||||
router.afterEach((to, from) => {
|
||||
if (from.name === to.name) {
|
||||
console.log("路由重复");
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
|
||||
export default router;
|
||||
|
||||
Reference in New Issue
Block a user