Skip to content

Commit 8641241

Browse files
committed
fix: GoToEvent query param
1 parent 5d9d604 commit 8641241

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/npm-fastui/src/events.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,14 @@ export function useFireEvent(): { fireEvent: (event?: AnyEvent) => void } {
3838
}
3939
case 'go-to':
4040
if (event.url) {
41+
let url = event.url
42+
if (event.query) {
43+
url += '?' + new URLSearchParams(event.query as Record<string, string>).toString()
44+
}
4145
if (event.target) {
42-
window.open(event.url, event.target)
46+
window.open(url, event.target)
4347
} else {
44-
location.goto(event.url)
48+
location.goto(url)
4549
}
4650
}
4751
if (event.query) {

0 commit comments

Comments
 (0)