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 on-change event of the [Bug Report] Checkbox Group component cannot receive an array of all options currently selected #5471

Closed
AILINGANGEL opened this issue Mar 21, 2019 · 4 comments

Comments

@AILINGANGEL
Copy link

AILINGANGEL commented Mar 21, 2019

Environment

Darwin Kernel Version 16.7.0/ chrome 72.0.3626.12 (64位)/ vue 3.3.2

Reproduction link

https://run.iviewui.com/McEY13pA

Steps to reproduce

点击选中多个checkbox选项

What is expected?

希望点击一个checkbox的时候,当前整个checkbox group中所有选中的选项都alert出来!!!

What is actually happening?

CheckboxGroup组件的on-change事件只有在使用了v-model双向绑定值的时候才会收到当前所选项的数组,单纯的使用:value或者不使用:value只绑定一个on-change事件只能收到当前点击过的选项,无法收到所有的选项。

@iview-bot iview-bot changed the title [Bug Report]CheckboxGroup组件的on-change事件无法收到当前所选的所有选项数组 The on-change event of the [Bug Report] Checkbox Group component cannot receive an array of all options currently selected Mar 21, 2019
@iview-bot
Copy link
Collaborator

Translation of this issue:

Environment

Darwin Kernel Version 16.7.0/ chrome 72.0.3626.12 (64 bits)/ Vue 3.3.2

Reproduction link

https://run.iviewui.com/McEY13pA

Steps to reproduce

Click to select multiple checkbox options

What is expected?

When you want to click on a checkbox, all the selected options in the current real checkbox group are alert!!!

What is actually happening?

The on-change event of the Checkbox Group component receives the currently selected array only when the bi-directional binding value of V-model is used. Simple use: value or no use: value only binds an on-change event to receive only the currently clicked option, not all the options.

@shizhenbin
Copy link

这个功能没有比加一个v-model方便的吧? 加参数跟加v-model好像没啥差

@AILINGANGEL
Copy link
Author

这不是新功能呀。就是说在ChecboxGroup这个组件上如果不使用v-model那么on-change事件接受到的值并不是当前group所有选中的项目,只是你点击的谁就收到谁,如果取消点击谁收到的还是[""]。这是个bug

@iview-bot
Copy link
Collaborator

Hello, this issue has been closed because it is not a bug, but a usage problem, please consult other communities.

@iview iview locked and limited conversation to collaborators Apr 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants