From aa6c75e59f9e79c595b05d6acba5eb82ccbefd6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Thu, 27 Feb 2025 23:05:21 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E8=B7=B3=E8=BD=AC=E4=B8=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index c79c65b0..d5b573d7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,7 +1,7 @@ /** * @file router index.ts * @description 路由入口 - * @since Beta v0.6.8 + * @since Beta v0.7.0 */ import { createRouter, createWebHistory } from "vue-router"; @@ -9,11 +9,13 @@ import { createRouter, createWebHistory } from "vue-router"; import routes from "./routes.js"; const router = createRouter({ history: createWebHistory(), routes: routes }); +// 只有在特定页面忽略参数变化 +const ignoreRoutes: ReadonlyArray = ["酒馆", "话题"]; // 解决路由重复问题 router.afterEach((to, from) => { if (from.name === to.name) { - if (from.query !== to.query) return; + if (from.query !== to.query && ignoreRoutes.includes(from.name?.toString() ?? "")) return; window.location.reload(); } });