Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
what ?
for solve issue #82, I add remove method.
为了解决 issue #82, 我添加了一个删除缓存的方法。
How to use ?
First you need get keepAliveProviderRef, and in correct time call it's method named removeCache like this:
首先,需要获取 keepAliveProviderRef ,并在合适的时间调用名为 removeCache 的方法,如下所示:
removeCache
receive string or string array as params which is name of KeepAlive.removeCache
接收字符串或者是字符串数组作为参数,参数来源于 KeepAlive 的属性 name。Note
If you use
react-router
, and need usehistory.push
when removeCache, you must usehistory.push
first and then use removeCache.如果你使用
react-router
, 你必须在使用removeCache
之前调用history.push