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

Select 组件的v-model:value传空,不显示placeholder #7580

Open
1 task
xuexirong opened this issue May 15, 2024 · 3 comments
Open
1 task

Select 组件的v-model:value传空,不显示placeholder #7580

xuexirong opened this issue May 15, 2024 · 3 comments

Comments

@xuexirong
Copy link

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

Version

4.2.1

Environment

Vue3

Reproduction link

https://github.com/vueComponent/ant-design-vue

Steps to reproduce

v-model:value传空

What is expected?

v-model:value传空,显示placeholder

What is actually happening?

v-model:value传空,不显示placeholder


有时候后台会传给前端某些字段默认值为空,不是null。这样为了这个需要我还要自己封装一下select组件

@Aaron-zon
Copy link

option的value可以设置为空的,当select的value设置为空,会认为你想要选择option为空的选项

@xuexirong
Copy link
Author

xuexirong commented May 16, 2024

@Aaron-zon 那如果我的option的value没有空的选项呢,当select的value设置为空,就是没匹配到,那就应该显示placeholder

@Aaron-zon
Copy link

我个人认为这种封装的组件应该遵守原生控件的规则,且符合大多数人的使用习惯。
当然只是我个人觉得,你等两天看看会不会有人给你加标签吧 ₍ᐢ..ᐢ₎

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

2 participants