Element: Checkbox cannot be selected when using true-label or false-true in [Bug Report] multi box group Checkbox-group.

Created on 20 Nov 2018  ·  5Comments  ·  Source: ElemeFE/element

Element UI version

2.4.10

OS/Browsers version

macOS mojave / chrome 版本 70.0.3538.102(正式版本) (64 位)

Vue version

2.5.17

Reproduction Link

https://jsfiddle.net/rongkun/un3eaz8h/25/

Steps to reproduce

  1. 多选框组中的checkbox使用true-lable属性,checkbox无法选中

What is Expected?

多选框组中的checkbox使用true-lable属性,checkbox可以选中

What is actually happening?

多选框组中的checkbox使用true-lable属性,checkbox可以选中

select

Most helpful comment

Can we have this issue in english please ? I may face the same problem with my checkbox-group behavior

All 5 comments

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

  1. the checkbox in the multi box group uses the true-lable attribute, and checkbox cannot be selected.

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-labelfalse-label。在 CheckboxGroup 中,v-model 的值不是布尔值。这里在使用 true-label,会导致计算不正确。

true-label 属性让人有些误解。当 CheckBox 选中时,绑定的值是 Boolean。如果不要 Boolean,可以设置 true-labelfalse-label。在 CheckboxGroup 中,v-model 的值不是布尔值。这里在使用 true-label,会导致计算不正确。

提出这个问题是在 CheckboxGroup 中使用true-labelfalse-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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smallpath picture smallpath  ·  3Comments

Kingwl picture Kingwl  ·  3Comments

yubo111 picture yubo111  ·  3Comments

sudo-suhas picture sudo-suhas  ·  3Comments

no5no6 picture no5no6  ·  3Comments