mirror of
https://github.com/metosin/reitit.git
synced 2026-02-06 20:13:11 +00:00
Pass uri fragments to history pushState
This commit is contained in:
parent
c829504b59
commit
35597aadf6
1 changed files with 4 additions and 2 deletions
|
|
@ -101,8 +101,10 @@
|
||||||
(reitit/match-by-path router (.getPath uri)))
|
(reitit/match-by-path router (.getPath uri)))
|
||||||
(.preventDefault e)
|
(.preventDefault e)
|
||||||
(let [path (str (.getPath uri)
|
(let [path (str (.getPath uri)
|
||||||
(if (seq (.getQuery uri))
|
(when (.hasQuery uri)
|
||||||
(str "?" (.getQuery uri))))]
|
(str "?" (.getQuery uri)))
|
||||||
|
(when (.hasFragment uri)
|
||||||
|
(str "#" (.getFragment uri))))]
|
||||||
(.pushState js/window.history nil "" path)
|
(.pushState js/window.history nil "" path)
|
||||||
(-on-navigate this path))))))]
|
(-on-navigate this path))))))]
|
||||||
(-on-navigate this (-get-path this))
|
(-on-navigate this (-get-path this))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue