Skip to content

Detect popstate vs push/replace in navigation guards #3453

Open
@posva

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

Metadata

Assignees

No one assigned

    Labels

    feature requestgroup[current route information]Issues regarding current route information that is currently missingneeds RFCThis feature request needs to go through the RFC process to gather more information

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions