Detect popstate
vs push
/replace
in navigation guards #3453
Open
Description
It would be useful to detect if navigation comes from interaction within the app (router.push()
) or outside of it (history.back()
).
The API is still to be decided and should be the same on v4 and v3, probably something inside of the to
parameter of navigation guards
router.beforeEach((to, from, next) => {
to.navigation.type // 'pop' | 'push'
to.replace // true | false
to.navigation.direction // number
Related #1620