Skip to content

fix(KeepAlive): different key of the same component call unmount #6235

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

Closed
wants to merge 1 commit into from

Conversation

hminghe
Copy link

@hminghe hminghe commented Jul 6, 2022

fix #6225

Copy link

@chenhaihong chenhaihong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

老哥,你的测试用例是不正确的。

KeepAlive[include='A'] A[key='1'] ==> 缓存A1
KeepAlive[include='A'] A[key='2'] ==> 缓存A2
KeepAlive[include='B'] A[key='2'] ==> 删除A1缓存
KeepAlive[include='B'] B[key='2'] ==> 删除A2缓存

你的测试用例的过程,之前的代码就能pass的。

@hminghe
Copy link
Author

hminghe commented Jul 16, 2022

老哥,你的测试用例是不正确的。

KeepAlive[include='A'] A[key='1'] ==> 缓存A1 KeepAlive[include='A'] A[key='2'] ==> 缓存A2 KeepAlive[include='B'] A[key='2'] ==> 删除A1缓存 KeepAlive[include='B'] B[key='2'] ==> 删除A2缓存

你的测试用例的过程,之前的代码就能pass的。

我测试了,并不能过。
image

@zezhongmiao
Copy link

fix #6225

pruneCache(name => matches(include, name)) 匹配正则的时候 带上key 是不是也可以 include :{ test : (name,key)=>{ 根据key 删除缓存 } }

Copy link

@yokiyokiyoki yokiyokiyoki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeap!

@hminghe hminghe closed this Feb 13, 2023
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

Successfully merging this pull request may close these issues.

keep-alive 下的组件加了上 key 没有触发 onBeforeUnmount
5 participants