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

首页设置缓存时路由缓存问题 #2565

Closed
anyanyan07 opened this issue May 13, 2021 · 3 comments
Closed

首页设置缓存时路由缓存问题 #2565

anyanyan07 opened this issue May 13, 2021 · 3 comments

Comments

@anyanyan07
Copy link

版本号:2.4.3
问题描述:首页keepAlive为true ,点击左侧菜单打开另一个keepAlive为true的菜单项,关闭tab,再打开同样的tab,tab没有重新加载。只有关闭紧挨着首页的tab时有这个bug。

操作步骤:
正常情况:首页(keepAlive=true)—>打开"流程设计(keepAlive=true)"——>—>打开"表单设计器(keepAlive=true)"——>关闭“流程设计”——>再打开“流程设计”,“流程设计”重新加载了。

异常情况:首页(keepAlive=true)—>打开"流程设计(keepAlive=true)"——>关闭“流程设计”——>再打开“流程设计”,此时流程设计页没有重新加载

只有两个tab(首页和另一个)的时候有这样的问题。

截图&代码:

image

友情提示: 未按格式要求发帖,会直接删掉。

@anyanyan07
Copy link
Author

anyanyan07 commented Jun 1, 2021

这几天跟了下代码逻辑和keep-alive的源码,发现时TabLayout和RouteView嵌套使用keep-alive的问题,自己改了下TabLayout的代码,暂时解决了问题,希望作者可以优化。
1.TabLayout增加如下代码
image

2.当只有首页时,排除RouteView的缓存
watch: { '$route': function(newRoute) { //......省略其它代码 //增加如下代码:只有首页时 if(this.pageList&&this.pageList.length==1&&this.pageList[0].fullPath==indexKey){ this.excludeRoutes = ['RouteView'] }else{ this.excludeRoutes = [] } },

@zhangdaiscott
Copy link
Member

收录 jl

@zhangdaiscott
Copy link
Member

未修复,暂时归集到#1312

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

2 participants