arco-design / arco-design-vue

A Vue.js 3 UI Library based on Arco Design
https://arco.design/vue
MIT License
2.68k stars 522 forks source link

select组件change方法,返回option数据 #2499

Open bojhkaka opened 1 year ago

bojhkaka commented 1 year ago

基本信息

现有案例

ant design vue或arco react版本的select组件change返回值效果

预期解决问题

select组件的change方法,请多返回一个option数据,目前该效果react版本已支持,请在vue版本支持,该方法很常用,急需

bojhkaka commented 1 year ago

感谢回复,不过这个方法需要兼容之前的返回值,为了不影响外层现有使用的场景,update:modelValue方法里得处理单选多选,change方法也需要处理单选多选的返回值

真的希望官方能支持,react版本还有labelin value属性,vue版本也没有😭

@. | ---- 回复的原邮件 ---- | 发件人 | @.> | | 发送日期 | 2023年06月16日 17:00 | | 收件人 | arco-design/arco-design-vue @.> | | 抄送人 | bojhkaka @.>, Author @.***> | | 主题 | Re: [arco-design/arco-design-vue] select组件change方法,返回option数据 (Issue #2499) |

目前可以不给select绑定值,利用chang事件将option返回出来暂时解决这个问题。

<a-select @change="handleSelectChange">
  <a-optionv-for="(item, index) of options"
    :key="index"
    :value="item"
    :label="item.label"
  />
</a-select>

consthandleSelectChange=(value)=>{console.log(value)}

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

lq9958 commented 1 year ago

暂时在change事件里面做一次过滤操作吧

bojhkaka commented 1 year ago

是的,准备在change里做下过滤,自己返回吧

但是,官方有计划支持不?真的很需要啊,跟react版本靠近一下 | |

@. | ---- 回复的原邮件 ---- | 发件人 | @.> | | 发送日期 | 2023年06月16日 18:09 | | 收件人 | arco-design/arco-design-vue @.> | | 抄送人 | bojhkaka @.>, Author @.***> | | 主题 | Re: [arco-design/arco-design-vue] select组件change方法,返回option数据 (Issue #2499) |

暂时在change事件里面做一次过滤操作吧

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

ZHIFENG1991 commented 1 year ago

确实很常用的功能需求,现在我都是用value数据去map一下label出来

zclzone commented 2 months ago

现在也还不支持,感觉没在维护了