-
Notifications
You must be signed in to change notification settings - Fork 113
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
缓存失效的bug #18
Comments
Hi! I am working with ReactCSSTransitionGroup and when switching between views it doesn't keep the state, this could be a bug related to this issue? |
@martinolazzeri Meaning CacheRoute doesn't work with TransitionGroup? It could be related to #30
Which causing I tend to think that this is not a bug but an unimplemented feature. I am going to working on it. |
ok, I will wait for the update! thanks! |
@CJY0208 大神,你大概什么时候有时间完善这个功能呢?我目前的项目用这两个组件也遇到了同样的问题 |
开发过程中遇到一个二级菜单不缓存的问题,解决了很久才解决,很容易找错方向,记录下来给以防后面的人遇到时无从下手。
asyncRouoter是按需加载组件,类似react的
Lazy
因为路由是动态生成的,所以使用了nunjucks模板。编译后替换{{ routes }}
当时发现,直接写在AutoRouter中的路由可以缓存,而routes中的不能缓存,所以觉得是二级路由的缓存匹配可能有问题。
调试了很多,无果,起了个新项目写了个demo,发现多级路由也是可以缓存的,那就把二级的目录直接写到AutoRouter中,发现可以缓存。
所以问题就在creteRoute方法上!
再进一步探索发现createRoute会返回新的component。所以加入缓存解决这个问题。
所以大家遇到不缓存的情况,确认没写错的情况下,可以去看看是不是返回了不同的component
The text was updated successfully, but these errors were encountered: