Commit 74d4d22f authored by Naoyuki Kanezawa's avatar Naoyuki Kanezawa Committed by Guillermo Rauch

router: fix route value on popstate (#490)

parent b9bee247
...@@ -25,8 +25,9 @@ export default class Router { ...@@ -25,8 +25,9 @@ export default class Router {
onPopState (e) { onPopState (e) {
this.abortComponentLoad() this.abortComponentLoad()
const { pathname, query } = parse(window.location.href, true) let { route } = e.state || {}
const route = (e.state || {}).route || toRoute(pathname) const { pathname, query } = parse(route || window.location.href, true)
if (!route) route = toRoute(pathname)
Promise.resolve() Promise.resolve()
.then(async () => { .then(async () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment