From a7bca9bd676d68d5cdca72c7a6286f78cc9a2573 Mon Sep 17 00:00:00 2001 From: thislight Date: Mon, 23 Dec 2024 18:30:58 +0800 Subject: [PATCH] StackedRouter: initializing stack supports query --- src/platform/StackedRouter.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/platform/StackedRouter.tsx b/src/platform/StackedRouter.tsx index f79da9a..c8f0417 100644 --- a/src/platform/StackedRouter.tsx +++ b/src/platform/StackedRouter.tsx @@ -578,7 +578,11 @@ const StackedRouter: Component = (oprops) => { createRenderEffect(() => untrack(() => { if (stack.length === 0) { - pushFrame(window.location.pathname, { + const parts = [window.location.pathname] as string[] + if (window.location.search) { + parts.push("?", window.location.search) + } + pushFrame(parts.join(''), { replace: "all", }); }