From aa4984f99764a5767077d1674c00c83470c92a51 Mon Sep 17 00:00:00 2001 From: huangxuan Date: Tue, 2 Apr 2024 10:53:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(router):=20=E4=BF=AE=E5=A4=8DHashRouter=20?= =?UTF-8?q?push=E4=B8=8E=E5=BD=93=E5=89=8D=E9=A1=B5=E9=9D=A2=E7=9B=B8?= =?UTF-8?q?=E5=90=8C=E7=9A=84URL=E6=97=B6=E9=A1=B5=E9=9D=A2=E4=B8=8D?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/inula-router/src/history/baseHistory.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/inula-router/src/history/baseHistory.ts b/packages/inula-router/src/history/baseHistory.ts index 87451567..0b1bffa0 100644 --- a/packages/inula-router/src/history/baseHistory.ts +++ b/packages/inula-router/src/history/baseHistory.ts @@ -66,7 +66,9 @@ export function getBaseHistory( Object.assign(historyProps, nextState); } historyProps.length = browserHistory.length; - const args = { location: historyProps.location, action: historyProps.action }; + // 避免location饮用相同时setState不触发 + const location = Object.assign({}, historyProps.location); + const args = { location: location, action: historyProps.action }; transitionManager.notifyListeners(args); }; }