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
[讨论] 如何花最小的成本实现多Tabs切换模式 #6126
Labels
Comments
umi 会支持 keep live ,到时候给layout 来个 pr,一键支持 |
我也在等umi的keep alive 😊 |
mark |
嵌套路由的状态可以用model存下来,匹配路由后再去model里找,而不是重新生成组件。 |
mark |
@xiaohuoni 看了演示网站,切换标签很卡, 没有iframe流畅 |
mark |
新鲜出炉,欢迎体验:https://github.com/MudOnTire/antd-pro-page-tabs 完美保持tab中的状态。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
相关讨论:#220
道理都懂,但有时候需求下来很难推掉。
昨天有一个朋友在群里问,有一点想法,所以今天搞了一个不是很好的方案。
有需要的朋友可以参考一下。
源码:@alitajs/tabs-layout/
前置条件
umi@3
已知BUG
嵌套路由的页面无法状态保持,但可以多tabs切换(不能状态保持的多tabs有什么意义?)
可能会修也可能不会,因为我们在真实项目中,嵌套路由用的比较少。
演示效果
最小成本
比如将pro项目改成多 Tabs ,只改需要10行代码。详情可以查看 alitajs/umi-antd-pro@c75e3a6
安装
配置
tabsLayout
是一个数组,写明需要使用 tabs 的页面,支持字符串和正则表达式,如需要全部匹配,可以设置tabsLayout: [/./]
。使用
需要使用
TabsLayout
替换children
。The text was updated successfully, but these errors were encountered: