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

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

Open
haizhilin2013 opened this issue Aug 5, 2019 · 4 comments
Labels
html html

Comments

@haizhilin2013
Copy link
Collaborator

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

@haizhilin2013 haizhilin2013 added the html html label Aug 5, 2019
@liuxiaole
Copy link

  • 未选中
  • 半选中
  • 选中

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

@xxf1996
Copy link

xxf1996 commented Aug 6, 2019

影响checkbox状态的属性有checkeddisabledindeterminate

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

@EragonBubble
Copy link

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

@nowherebutup
Copy link

  • 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
Labels
html html
Projects
None yet
Development

No branches or pull requests

5 participants