StackedRouter: initializing stack supports query

This commit is contained in:
thislight 2024-12-23 18:30:58 +08:00
parent 3444068fd8
commit a7bca9bd67
No known key found for this signature in database
GPG key ID: FCFE5192241CCD4E

View file

@ -578,7 +578,11 @@ const StackedRouter: Component<StackedRouterProps> = (oprops) => {
createRenderEffect(() => createRenderEffect(() =>
untrack(() => { untrack(() => {
if (stack.length === 0) { 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", replace: "all",
}); });
} }