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

[Tabbar] Tabbar组件中的TabItem添加key属性(key的类型可以是string或number)作为唯一标识,调用change方法时,可以传入key #2

Closed
qinains opened this issue Aug 9, 2023 · 2 comments

Comments

@qinains
Copy link

qinains commented Aug 9, 2023

这个功能解决了什么问题

切换不同的角色,底部需要让某个tabItem点亮。当底部tabItem有增删时,如果只有传index,就很容易搞混。change方法中的index传入key,就很安全

你建议的方案是什么

tabItem添加key属性用来做唯一标识。tabbar的change方法中index类型是string或number,当是string的时候,跟tabItem中的key匹配

@qinains qinains changed the title [组件名称] 问题描述 [标签栏 Tabbar] 中的TabItem添加name属性作为唯一标识,调用change方法时,可以传入name Aug 9, 2023
@qinains qinains changed the title [标签栏 Tabbar] 中的TabItem添加name属性作为唯一标识,调用change方法时,可以传入name [Tabbar] Tabbar组件中的TabItem添加name属性作为唯一标识,调用change方法时,可以传入name Aug 9, 2023
@qinains qinains changed the title [Tabbar] Tabbar组件中的TabItem添加name属性作为唯一标识,调用change方法时,可以传入name [Tabbar] Tabbar组件中的TabItem添加key属性作为唯一标识,调用change方法时,可以传入name Aug 9, 2023
@qinains qinains changed the title [Tabbar] Tabbar组件中的TabItem添加key属性作为唯一标识,调用change方法时,可以传入name [Tabbar] Tabbar组件中的TabItem添加key属性(key的类型可以是string或number)作为唯一标识,调用change方法时,可以传入key Aug 9, 2023
@yisa1023
Copy link

yisa1023 commented Aug 9, 2023

@qinains 感谢您提出了 issue,我们将尽快检查并回复你。

nobu121 added a commit that referenced this issue Aug 9, 2023
- 修改tabItem 属性 title -> name。
- onChange 事件默认返回 tabItem.name。若未定义name则返回index

Issus: #2
@nobu121
Copy link
Contributor

nobu121 commented Aug 9, 2023

@qinains 已添加该功能

@nobu121 nobu121 closed this as completed Aug 9, 2023
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

3 participants