Skip to content

Support array syntax in beforeEnter #2688

Open
@posva

Description

@posva

What problem does this feature solve?

This will allow splitting guard logic in smaller functions and making it easy to chain them. It's similar to express middlewares

What does the proposed API look like?

{ path: '/some', beforeEnter: [authGuard, adminGuard] }

current solution to this: https://www.npmjs.com/package/vue-router-multiguard

Edit: Supporting arrays for in-component guards seems unnecessary as a component guard is specific to a component, they are not reused. On top of that, the typing of this would probably break so I removed them from the proposal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestfixed on 4.xThis issue has been already fixed on the v4 but exists in v3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions