<tap-checkbox>
复选框与复选框组。用于在多个选项中进行多项选择,支持半选(indeterminate)状态。
Example
Loading...
<tap-checkbox .checked=${true}> 已勾选 </tap-checkbox> <tap-checkbox .checked=${false}> 未勾选 </tap-checkbox> <tap-checkbox .indeterminate=${true}> 半选状态 </tap-checkbox> <tap-checkbox .disabled=${true} .checked=${true}> 禁用选项 </tap-checkbox>
Loading...
<tap-checkbox-group
.heading=${"水果"}
.value=${["apple","banana"]}
.options=${ [ {"label":"苹果","value":"apple"}, { "label": "香蕉", "value": "banana", "description": "黄色水果" }, {"label":"橙子","value":"orange","disabled":true} ] }
@change=${(evt) => evt.currentTarget.value = evt.detail}></tap-checkbox-group>
<tap-checkbox> API
Shadow DOM; Extends GemElement
Instance Properties
| Property(Attribute) | Reactive | Type |
|---|---|---|
checked(checked) |
Yes | boolean |
indeterminate(indeterminate) |
Yes | boolean |
disabled(disabled) |
Yes | boolean |
change |
Emitter<boolean> |
|
value(value) |
Yes | string |
label(label) |
Yes | string |
Other
| Type | Value |
|---|---|
| Event | change |
| Slot | unnamed |
| CSS State | delegate-focus |
<tap-checkbox-group> API
Extends GemElement
Instance Properties
| Property(Attribute) | Reactive | Type |
|---|---|---|
orientation(orientation) |
Yes | 'horizontal' | 'vertical' |
heading(heading) |
Yes | string |
disabled(disabled) |
Yes | boolean |
change |
Emitter<any[]> |
|
value |
Yes | any[] |
options |
Yes | Option[] |
Other
| Type | Value |
|---|---|
| Event | change |
| CSS State | tap-list |
