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

keep-alive结合compontent使用,当切换的组件是多个页面共用时,include不能区分这些页面从而删掉缓存 #8310

Closed
lizijins opened this issue Jun 6, 2018 · 1 comment

Comments

@lizijins
Copy link

lizijins commented Jun 6, 2018

What problem does this feature solve?

利用keep-alive结合compontent,实现切换tab的效果。但是有多个tab用同一个组件的情况,我加了key做区分,如下:
<component :is="currentTabComponent" :key="moduleId" ></component>
这样,可以缓存这些使用同一个组件的tab。问题是,删除tab时,用include只能匹配组件的name或注册名,并不能区分使用相同组件的tab。
然后我用$desytoy销毁,再次创建时又会有组件不断created,缓存不了的现象。
有什么办法解决这种场景吗?

What does the proposed API look like?

include中是否可以把key带进去,区分组件相同key不同的缓存实例

@haoqunjiang
Copy link
Member

Duplicate of #8028

@haoqunjiang haoqunjiang marked this as a duplicate of #8028 Jun 6, 2018
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

2 participants