8000 Autofilled params for named route cause warning with keep-alive · Issue #2820 · vuejs/vue-router · GitHub
[go: up one dir, main page]

Skip to content
Autofilled params for named route cause warning with keep-alive #2820
Closed
@matej-svejda

Description

@matej-svejda

Version

3.0.3

Reproduction link

https://jsfiddle.net/fp3et456/5/

Steps to reproduce

Going to "withProps1" and then back to "withoutProps"

What is expected?

That no warning should appear.

What is actually happening?

Causes a vue warning to appear for missing params, even though the params for all routes on the current route are set.


Im using auto filled params in named routes that the current route also has. An example would be that all project-related routes have the project id in them, but i dont want to set it every time when construct a route while being in a project-related route. Vue router does this automatically. I didnt find the functionallity documented, but you can see it being implemented in the function match(...) in create-matcher.js.
This works well in all cases, it only causes warning when Im navigating away from a route that has such a "shared param" to a route that doesnt have it. It seems like while leaving the route, something triggers a re-render of the links and the path is reconstructed. However, in this case the parameter can't be autofilled anymore because it isn't present in the current route.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0