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

[Docs/Examples] Fetch-Before-Navigation example when using Vuex #2699

Open
JivanRoquet opened this Issue Apr 9, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@JivanRoquet
Copy link

JivanRoquet commented Apr 9, 2019

Version

3.0.3

Reproduction link

https://router.vuejs.org/guide/advanced/data-fetching.html#fetching-before-navigation

Steps to reproduce

  • visit https://router.vuejs.org/guide/advanced/data-fetching.html#fetching-before-navigation
  • reproduce the example shown
  • try to adapt them to a component having its state managed by Vuex (and accessing it through mapState)
  • observe that adapting these examples is not a trivial matter
  • in particular, naive adaptations tend to result in a situation where the component gets disconnected from the state after going through the beforeRouteUpdate() hook.

What is expected?

Seeing examples with both internally-managed state (via component's data attribute) and Vuex-managed state (via store)

What is actually happening?

Only examples with internally-managed state appear


The examples provided in the fetch-before-navigation section focus exclusively on using the component's own data attribute

A quite standard way of fetching data before navigation while using Vuex-managed components probably exists out there, and it would probably be a useful addition to mention it in the examples provided.

@posva posva added the docs label Apr 10, 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.