Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support array syntax for guards #2688

Open
posva opened this Issue Mar 28, 2019 · 0 comments

Comments

1 participant
@posva
Copy link
Member

posva commented Mar 28, 2019

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', beforeEach: [authGuard, adminGuard], afterEach: [after1, after2] }

// in component
beforeRouteEnter: [authGuard, adminGuard],
beforeRouteUpdate: [authGuard, adminGuard],
beforeRouteLeave: [confirmGuard, doubleConfirmGuard]

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

@posva posva added this to Design proposals + discussion (high prio, high complex) in Longterm Mar 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.