2.4.10
macOS mojave / chrome 版本 70.0.3538.102(正式版本) (64 位)
2.5.17
https://jsfiddle.net/rongkun/un3eaz8h/25/
多选框组中的checkbox使用true-lable属性,checkbox可以选中
多选框组中的checkbox使用true-lable属性,checkbox可以选中
Translation of this issue:
Element UI version
2.4.10
OS/Browsers version
MacOS Mojave / Chrome version 70.0.3538.102 (official version) (64 bits)
Vue version
2.5.17
Reproduction Link
https://jsfiddle.net/rongkun/un3eaz8h/25/
Steps to reproduce
What is Expected?
The checkbox in the multi box group uses the true-lable attribute, and checkbox can be selected.
What is actually happening?
The checkbox in the multi box group uses the true-lable attribute, and checkbox can be selected.
true-label 属性让人有些误解。当 CheckBox 选中时,绑定的值是 Boolean。如果不要 Boolean,可以设置 true-label 与 false-label。在 CheckboxGroup 中,v-model 的值不是布尔值。这里在使用 true-label,会导致计算不正确。
true-label属性让人有些误解。当 CheckBox 选中时,绑定的值是 Boolean。如果不要 Boolean,可以设置true-label与false-label。在 CheckboxGroup 中,v-model 的值不是布尔值。这里在使用true-label,会导致计算不正确。
提出这个问题是在 CheckboxGroup 中使用true-label与false-label`时CheckBox根本无法选中,而不是计算不准确
或者你的意思是计算不准确导致CheckBox无法选中?确定这个不是bug?
在提问中已经发布了事例
就拿官网上的例子来说:
<el-checkbox-group v-model="checkList">
<el-checkbox label="复选框 A"></el-checkbox>
<el-checkbox label="复选框 B"></el-checkbox>
<el-checkbox label="复选框 C"></el-checkbox>
<el-checkbox label="禁用" disabled></el-checkbox>
<el-checkbox label="选中且禁用" disabled></el-checkbox>
</el-checkbox-group>
这里的 checkList 是一个数组,是选中的 label 值数组。
<el-checkbox label="复选框 A" v-model="checked"></el-checkbox>
这里 checked 的是一个布尔值。
checkbox-group 与 checkbox 有着很大的差别。
Can we have this issue in english please ? I may face the same problem with my checkbox-group behavior
Most helpful comment
Can we have this issue in english please ? I may face the same problem with my checkbox-group behavior