mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-15 09:48:14 +08:00
♻️ 重构部分路由处理
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file router index.ts
|
||||
* @description 路由入口
|
||||
* @since Beta v0.3.3
|
||||
* @since Beta v0.6.8
|
||||
*/
|
||||
|
||||
import { createRouter, createWebHistory } from "vue-router";
|
||||
@@ -12,7 +12,8 @@ const router = createRouter({ history: createWebHistory(), routes: routes });
|
||||
|
||||
// 解决路由重复问题
|
||||
router.afterEach((to, from) => {
|
||||
if (from.name === to.name && from.fullPath !== to.fullPath) {
|
||||
if (from.name === to.name) {
|
||||
if (from.query !== to.query) return;
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user