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

why the redirect function executes twice #2566

Closed
changk99 opened this Issue Jan 2, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@changk99
Copy link

changk99 commented Jan 2, 2019

Version

3.0.1

Reproduction link

https://jsfiddle.net/changli/38sft2x0/1/

Steps to reproduce

1、 click the home
2、 click the toAbout

What is expected?

1、 the redirect function will not be called
2 、the redirect function will be called once

What is actually happening?

1、 the redirect function will be called once
2、 the redirect function will be called twice

@posva

This comment has been minimized.

Copy link
Member

posva commented Jan 2, 2019

redirect is executed by router-links to compute the destination. It's not to be used as a hook. Remember you can also redirect in a beforeEnter hook by calling the next function with a parameter

@posva posva closed this Jan 2, 2019

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