diff --git a/src/router/router-engine.js b/src/router/router-engine.js index 678e013..5ac34cf 100644 --- a/src/router/router-engine.js +++ b/src/router/router-engine.js @@ -23,6 +23,7 @@ class Router { #ready = false #route = Object.create(null) + #tmp = null #beforeEach @@ -133,7 +134,6 @@ class Router { this.#exec(next) }) } - return this.#exec(next) } } @@ -142,6 +142,11 @@ class Router { $view.current = route.name this.#route = { path, name: route.name, params: {}, query: {} } this.#exec(this.#route) + } else { + if (this.#tmp) { + this.#exec(this.#tmp) + this.#tmp = null + } } } @@ -215,6 +220,8 @@ class Router { return } + this.#tmp = obj + if (this.type === MODE_HASH) { if (replace) { location.replace(path.replace(/^\//, '#/'))