Skip to content

Unify next() for beforeRouteUpdate and beforeRouteEnter #1676

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

Closed
zatziky opened this issue Aug 10, 2017 · 2 comments
Closed

Unify next() for beforeRouteUpdate and beforeRouteEnter #1676

zatziky opened this issue Aug 10, 2017 · 2 comments

Comments

@zatziky
Copy link

zatziky commented Aug 10, 2017

What problem does this feature solve?

Hi there,

it would make our code base simpler if we received vm in beforeRouteUpdate too even though this method already has access to this. Then if the same logic applies for beforeRouteUpdate and beforeRouteEnter it could be handled uniformly in one method only:

beforeRouteUpdate(to, from, next){
   handleRouteChange(to, from, next)
},

beforeRouteEnter(to, from, next){
   handleRouteChange(to, from, next)
}

Yes, sometimes you need to handle both the methods in a different way but if not this is a nice short cut. Is it possible to do it in Vue.js or not?

Kind regards,

Nobo

@posva
Copy link
Member

posva commented Aug 10, 2017

dup of #1582

@LinusBorg
Copy link
Member

Reopening for further discussion following #1582 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants