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

The problem that Option cannot use Number type in Select multi-select mode #4570

Closed
1 task
Hccake opened this issue Aug 24, 2021 · 3 comments
Closed
1 task
Labels

Comments

@Hccake
Copy link

Hccake commented Aug 24, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.7.7

Environment

Windows, Chrome, Vue 2.6.12

Reproduction link

Edit on CodeSandbox

Steps to reproduce

使用 number 作为 option 的值

What is expected?

多选模式下支持 number 作为 option 的值

What is actually happening?

报错


想了解下为什么这么设计,使用 Number 作为 Option 的值,应该是一个比较常见的需求

@github-actions github-actions bot changed the title Select 多选模式下 Option 无法使用 Number 类型的问题 The problem that Option cannot use Number type in Select multi-select mode Aug 24, 2021
@tangjinzhou
Copy link
Member

基础组件逻辑来源于 react-component ant-design/ant-design#2857
react版本由于依赖 key,而且key只能为 string,所以限制了 string 类型,可以看看这个 pr react-component/select#229

虽然 vue 没有 string 限制,但有大量逻辑判断是基于string类型的,导致简单的放开类型权限会有较多问题

不过我们会在 2.2.7 版本中去掉该限制

@Hccake
Copy link
Author

Hccake commented Aug 24, 2021

感谢回答,那这边就暂时只能先对数据做下特殊处理了,期待后续版本更新

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants