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

Segment 能否传输自定义的值 #973

Closed
zhyphil opened this issue Jul 26, 2020 · 5 comments · Fixed by #974
Closed

Segment 能否传输自定义的值 #973

zhyphil opened this issue Jul 26, 2020 · 5 comments · Fixed by #974
Assignees
Labels
Feature Issue 提出了一个新功能 Segment 选项卡组件 已解决:+1: Issue 已解决

Comments

@zhyphil
Copy link

zhyphil commented Jul 26, 2020

描述你希望的支持的新功能?

现在在bind:linchange里面只能拿到{activeKey:当前激活选项卡的key,currentIndex:当前激活选项卡的索引} 两个值,能不能添加任意入口用以设置自定义值,比如我现在想要 给一个 id,方便做搜索, 在l-segment里面加入 data-id="{{id}}" 是不能获取到这个id 值的.

你期望的 API 是怎样的?
给segement添加任意自定义值的入口,或者 直接可以 拿到 data-*="{{value}}" 的设置, 在event.currentTarget.dataset.*中获取

谢谢

@juzi214032 juzi214032 self-assigned this Jul 26, 2020
@juzi214032 juzi214032 added Segment 选项卡组件 待反馈:mag: Issue 等待反馈中…… Feature Issue 提出了一个新功能 and removed 待反馈:mag: Issue 等待反馈中…… labels Jul 26, 2020
@juzi214032
Copy link
Member

感谢反馈,我们会增加此特性的支持

@juzi214032 juzi214032 added the 处理中:construction: Issue 已确认,正在写代码…… label Jul 26, 2020
@juzi214032
Copy link
Member

您好,请问一下您的这个需求用现有的 currentIndex无法实现吗,你在页面维护一个数组,通过这个 currentIndex 索引从数组中取值

juzi214032 added a commit that referenced this issue Jul 28, 2020
可在 segment-item 组件上使用如下方式绑定数据:
<l-segment-item data-cell="测试数据" />

该数据可在 bind:linchange 事件中获取

close #973
@juzi214032 juzi214032 linked a pull request Jul 28, 2020 that will close this issue
@juzi214032 juzi214032 added 已解决:+1: Issue 已解决 and removed 处理中:construction: Issue 已确认,正在写代码…… labels Jul 28, 2020
@zhyphil
Copy link
Author

zhyphil commented Jul 28, 2020

你好,我现在是通过key传递的id值,但是如果要传其他值的话,感觉这个写法语义上不搭配.

https://doc.mini.talelin.com/component/nav/segment.html

在doc里面没有看到哪一个属性对应传参给currentIndex

也许技术上这样是可以传递参数,但是感觉也只能是临时的吧.

@juzi214032
Copy link
Member

目前已增加data-cell传值方式,将在下一个版本更新

@zhyphil
Copy link
Author

zhyphil commented Jul 28, 2020

好的!谢谢

@zhyphil zhyphil closed this as completed Jul 28, 2020
juzi214032 added a commit that referenced this issue Jul 29, 2020
可在 segment-item 组件上使用如下方式绑定数据:
<l-segment-item data-cell="测试数据" />

该数据可在 bind:linchange 事件中获取

close #973
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Issue 提出了一个新功能 Segment 选项卡组件 已解决:+1: Issue 已解决
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants