From d21310ad848bc709b8f364a66a109cc3bf53da2f Mon Sep 17 00:00:00 2001 From: "zhiqiang.guo" Date: Tue, 13 Aug 2024 20:33:57 +0800 Subject: [PATCH] fix locationHistory incorrect when history pop --- packages/vue-router/src/router.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/vue-router/src/router.ts b/packages/vue-router/src/router.ts index 35ce3d55a94..1e8ae831c13 100644 --- a/packages/vue-router/src/router.ts +++ b/packages/vue-router/src/router.ts @@ -307,7 +307,7 @@ export const createIonRouter = ( } const leavingUrl = - leavingLocationInfo.pathname + leavingLocationInfo.search; + leavingLocationInfo.pathname + leavingLocationInfo.search ? '+' : '' + leavingLocationInfo.search; if (leavingUrl !== location.fullPath) { if (!incomingRouteParams) { if (action === "replace") { @@ -474,6 +474,8 @@ export const createIonRouter = ( ) { locationHistory.clearHistory(routeInfo); locationHistory.add(routeInfo); + }else{ + locationHistory.add(routeInfo); } } else { locationHistory.add(routeInfo);