Skip to content

Add afterRouteEnter guard #2840

@ykushev

Description

@ykushev

What problem does this feature solve?

I want execute one function in component after each routing (enter route, reused in the new route)

What does the proposed API look like?

variant 1:

beforeRouteUpdate (to, from, next) {
        console.log('page category beforeRouteUpdate');
        next(() => {
            // this don't calling
            console.log('page category beforeRouteUpdate next');
            this.$store.dispatch('catalog/exec');
        });
    },

variant 2: add hook named "afterRouteUpdate" that will calling after we enter in route and after each time we navigating in this route (foo/2 -> foo/3)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions