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

🐛 [Bug]: tiny-select的change事件不能拿到选择的对象,只能获取选择的值 #2614

Closed
552847957 opened this issue Dec 5, 2024 · 8 comments
Assignees
Labels
bug Something isn't working need discussion 需要讨论

Comments

@552847957
Copy link

Version

@opentiny/[email protected]

Vue Version

3.0

Link to minimal reproduction

tiny-select的change事件不能拿到对象值,只能获取选择的值

Step to reproduce

tiny-select的change事件中不能拿到对象值,只能获取选择的值

What is expected

No response

What is actually happening

No response

What is your project name

1

Any additional comments (optional)

No response

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: 🐛 [Bug]: The change event of tiny-select cannot get the object value, but can only get the selected value.

@552847957 552847957 changed the title 🐛 [Bug]: tiny-select的change事件不能拿到对象值,只能获取选择的值 🐛 [Bug]: tiny-select的change事件不能拿到选择的对象,只能获取选择的值 Dec 5, 2024
@kagol kagol added the bug Something isn't working label Dec 10, 2024
@shenjunjian
Copy link
Collaborator

image
官网上有这个示例的, 用户的需求应该使用这个方案。

@wNing50 的pr, 给事件最后补了一个参数,是不会带来破坏性变更。
但是select组件的大部分用户场景,都用不到最后一个参数, 通常只需要用到绑定value值,比如商品编码。 这个多余的消耗是否必要,还是让用户自己去过滤出来对象,更合理呢?

我们内部讨论一下,再决定是否需要合入吧

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


image
There is an example of this on the official website, and users should use this solution based on their needs.

@wNing50's PR adds a parameter to the event, which will not cause destructive changes.
However, most user scenarios of the select component do not use the last parameter. Usually only the bound value, such as the product code, is needed. Is this extra consumption necessary, or is it more reasonable to let users filter out the objects themselves?

Let's discuss it internally and decide whether we need to merge.

@shenjunjian shenjunjian added the need discussion 需要讨论 label Jan 3, 2025
@552847957
Copy link
Author

552847957 commented Jan 6, 2025 via email

@shenjunjian
Copy link
Collaborator

@552847957 请使用 “绑定对象”的方式, 这样change可以拿到对象。

@wNing50 我们讨论了下,暂不合入了。
1、增加参数个数可能影响某些人的用法
2、让用户自己去过滤出来对象更好,避免组件内的过滤,大多数人的场景不需要绑定对象的。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


@552847957 Please use the "binding object" method so that change can get the object.

@wNing50 We discussed it and decided not to join in for the time being.

  1. Increasing the number of parameters may affect some people’s usage
  2. It is better to let users filter out objects themselves and avoid filtering within components. Most people do not need to bind objects in their scenarios.

@wNing50
Copy link
Contributor

wNing50 commented Jan 6, 2025

okok

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


reasons

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need discussion 需要讨论
Projects
None yet
Development

No branches or pull requests

5 participants