Skip to content

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

Open
@JivanRoquet

Description

@JivanRoquet

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions