Skip to content

[html] 第112天 你知道checkbox有几种状态吗?它们分别用来表示什么? #1029

Open
@haizhilin2013

Description

@haizhilin2013
Collaborator

第112天 你知道checkbox有几种状态吗?它们分别用来表示什么?

Activity

liuxiaole

liuxiaole commented on Aug 6, 2019

@liuxiaole
  • 未选中
  • 半选中
  • 选中

由 checked 来控制 选中/ 未选中,由 indeterminate 来控制半选中状态,半选中不影响 checked 的值,只影响 UI 显示。

xxf1996

xxf1996 commented on Aug 6, 2019

@xxf1996

影响checkbox状态的属性有checkeddisabledindeterminate

  • checked:选中/未选中状态;
  • disabled:禁用/可用状态;
  • indeterminate:用于表示复选框组介于全部选中或全部未选中之间的状态;
EragonBubble

EragonBubble commented on Aug 6, 2019

@EragonBubble

checked - 选中
unchecked- 未选中
indeterminate - 不确定,不影响checkbox的值,只是让UI更友好一点

nowherebutup

nowherebutup commented on Aug 6, 2019

@nowherebutup
  • checked = true;选中
  • checked = false; 未被勾选
  • indeterminate = true; 半选钩中
  • indeterminate = false; 半选未钩中
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @liuxiaole@haizhilin2013@xxf1996@EragonBubble@nowherebutup

        Issue actions

          [html] 第112天 你知道checkbox有几种状态吗?它们分别用来表示什么? · Issue #1029 · haizlin/fe-interview