ant-design-vue icon indicating copy to clipboard operation
ant-design-vue copied to clipboard

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

Open xuexirong opened this issue 1 year ago • 3 comments
trafficstars

  • [ ] 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组件

xuexirong avatar May 15 '24 06:05 xuexirong

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

Aaron-zon avatar May 16 '24 01:05 Aaron-zon

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

xuexirong avatar May 16 '24 01:05 xuexirong

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

Aaron-zon avatar May 16 '24 02:05 Aaron-zon

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Jul 15 '24 02:07 github-actions[bot]