feat: add remove cache method#97
Open
kavience wants to merge 6 commits intoStructureBuilder:masterfrom
Open
Conversation
Open
Author
|
临时使用方法: 修改 其它功能使用方法不变,仅添加一个 |
This was referenced Sep 15, 2020
Add remove method
|
How to force rerender (refresh) the keepalive component (page) ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 的方法,如下所示:
removeCachereceive string or string array as params which is name of KeepAlive.removeCache接收字符串或者是字符串数组作为参数,参数来源于 KeepAlive 的属性 name。Note
If you use
react-router, and need usehistory.pushwhen removeCache, you must usehistory.pushfirst and then use removeCache.如果你使用
react-router, 你必须在使用removeCache之前调用history.push