Skip to content

Commit 1a068b3

Browse files
committed
also expose prev route in afterEach hooks
1 parent 02c7e07 commit 1a068b3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/history/base.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,11 @@ export class History {
9797
}
9898

9999
updateRoute (route: Route) {
100+
const prev = this.current
100101
this.current = route
101102
this.cb && this.cb(route)
102103
this.router.afterHooks.forEach(hook => {
103-
hook && hook(route)
104+
hook && hook(route, prev)
104105
})
105106
}
106107
}

0 commit comments

Comments
 (0)