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

在umi中使用不生效 #5

Closed
LiuL0703 opened this issue Dec 18, 2019 · 7 comments
Closed

在umi中使用不生效 #5

LiuL0703 opened this issue Dec 18, 2019 · 7 comments
Assignees

Comments

@LiuL0703
Copy link

"react": "16.12.0",
"umi": "2.10.6",
"umi-plugin-keep-alive": "^0.0.1-beta.6",
@LiuL0703
Copy link
Author

并未缓存内容 @CJY0208

@CJY0208
Copy link
Member

CJY0208 commented Jun 12, 2020

可以在 umi@3,x 中尝试 [email protected] 版本试试

@rudyzou
Copy link

rudyzou commented Jun 22, 2020

删除缓存好像没效果诶,dropscope

@phoebeCodeSpace
Copy link

删除缓存好像没效果诶,dropscope

我也没效果。😹

@CJY0208
Copy link
Member

CJY0208 commented Jul 1, 2020

@phoebeCodeSpace @rudyzou
抱歉现在才注意到这条留言,请问你们是在 KeepAlive 激活期间使用 drop 相关动作吗?

react-activation 忽略了这个行为,因为这被认为不属于 “drop” 动作而是 "refresh"

此场景下需要使用 refresh、refreshScope 而不是 drop

如果是多 tabs 标签,需要是关闭后回到上一个路由或者标签的需求场景,那需要在进行路由切换,触发 KeepAlive 的卸载后再调用 drop 函数

原因是 react-activation 被设计为与路由系统无关,不会主动猜测路由行为且进行路由引导

@phoebeCodeSpace
Copy link

@phoebeCodeSpace @rudyzou
抱歉现在才注意到这条留言,请问你们是在 KeepAlive 激活期间使用 drop 相关动作吗?

react-activation 忽略了这个行为,因为这被认为不属于 “drop” 动作而是 "refresh"

此场景下需要使用 refresh、refreshScope 而不是 drop

如果是多 tabs 标签,需要是关闭后回到上一个路由或者标签的需求场景,那需要在进行路由切换,触发 KeepAlive 的卸载后再调用 drop 函数

原因是 react-activation 被设计为与路由系统无关,不会主动猜测路由行为且进行路由引导

早上研究了下确实是这个问题,在当前路由下关闭tab,drop无效。
refresh、refreshScope解决方案可行。感谢~

@CJY0208
Copy link
Member

CJY0208 commented Mar 28, 2021

试试 0.0.1-beta.25,drop 更智能了一些

@CJY0208 CJY0208 closed this as completed Mar 28, 2021
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

4 participants