Skip to content
This repository was archived by the owner on Dec 19, 2017. It is now read-only.

Commit a57f348

Browse files
committed
Ensure child router afterDispose middleware is called when parent navigates
1 parent 140cf12 commit a57f348

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/router.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class Router {
146146
dispose() {
147147
document.removeEventListener(events.click, this.onclick, false)
148148
window.removeEventListener(events.popstate, this.onpopstate, false)
149-
Router.unlink(this)
149+
Router.unlink()
150150
if (this.isRoot) {
151151
this.ctx.route.runBeforeDispose().then(() => this.ctx.route.runAfterDispose())
152152
}
@@ -200,11 +200,8 @@ class Router {
200200
}
201201
}
202202

203-
static unlink(router) {
203+
static unlink() {
204204
routers.pop()
205-
if (!router.isRoot) {
206-
delete router.$parent.$child
207-
}
208205
}
209206

210207
static onclick(e) {

0 commit comments

Comments
 (0)