Select 组件的v-model:value传空,不显示placeholder
xuexirong opened this issue · comments
kakaxi commented
- 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 commented
option的value可以设置为空的,当select的value设置为空,会认为你想要选择option为空的选项
kakaxi commented
@Aaron-zon 那如果我的option的value没有空的选项呢,当select的value设置为空,就是没匹配到,那就应该显示placeholder
Aaron-zon commented
我个人认为这种封装的组件应该遵守原生控件的规则,且符合大多数人的使用习惯。
当然只是我个人觉得,你等两天看看会不会有人给你加标签吧 ₍ᐢ..ᐢ₎