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

Expose (store) history state stack #2393

Closed
lakca opened this issue Sep 17, 2018 · 3 comments
Closed

Expose (store) history state stack #2393

lakca opened this issue Sep 17, 2018 · 3 comments

Comments

@lakca
Copy link

lakca commented Sep 17, 2018

What problem does this feature solve?

As we know, for security reasons, browsers do not expose visited pages history.
But if in a single page application , it will be very helpful to access the history stack.
For example, I can clarify if it should directly back to previous or redirect to specific page when logged in.
although I can replace these with other approaches in different scenarios or maintain this by myself.
Appreciate it!

What does the proposed API look like?

router.history.stack or others are all okay.

@JounQin
Copy link
Contributor

JounQin commented Sep 17, 2018

Or maybe you can just implement a plugin for it, not everyone needs this feature and should not affect the core library.

@posva
Copy link
Member

posva commented Sep 17, 2018

The funny thing is we don't have it in history mode. This should be doable through a plugin though by branching into router.afterEach
In abstract mode, you do have access to it

For example, I can clarify if it should directly back to previous or redirect to specific page when logged in.

You should probably save the redirect url in a query parameter and read it when successfully logged in, then redirect

@posva posva closed this as completed Sep 17, 2018
@lakca
Copy link
Author

lakca commented Sep 18, 2018

Okay, I see, maybe it's not the attention of vue-router.
Thanks.

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

No branches or pull requests

3 participants