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 {
onPopState (e) {
this.abortComponentLoad()
const { pathname, query } = parse(window.location.href, true)
const route = (e.state || {}).route || toRoute(pathname)
let { route } = e.state || {}
const { pathname, query } = parse(route || window.location.href, true)
if (!route) route = toRoute(pathname)
Promise.resolve()
.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