Skip to content

keep-alive include will also cache anonymous components #6938

@PanJiaChen

Description

@PanJiaChen

Version

2.5.2

Reproduction link

https://jsfiddle.net/L613xva0/13/

Steps to reproduce

triggle the route

What is expected?

the second route component not be cached

What is actually happening?

the second route component be cached


this demo tow router-view component both have name, the result is right ,
but in this demo, the second route have no name ,but also be cached

The match is first checked on the component’s own name option, then its local registration name (the key in the parent’s components option) if the name option is not available. Anonymous components cannot be matched against.

<keep-alive :include="cachePages">
  <router-view></router-view>
</keep-alive>

when l keep-alive router-view , every anonymous component page will be cached , i don't think is reasonable.

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