You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design-vue/components/checkbox/index.en-US.md

2.1 KiB

category type title cover
Components Data Entry Checkbox https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*DzgiRbW3khIAAAAAAAAAAAAADrJ8AQ/original

Checkbox component.

When To Use

  • Used for selecting multiple values from several options.
  • If you use only one checkbox, it is the same as using Switch to toggle between two states. The difference is that Switch will trigger the state change directly, but Checkbox just marks the state as changed and this needs to be submitted.

API

Props

Checkbox

Property Description Type Default Version
autofocus get focus when component mounted boolean false
checked(v-model) Specifies whether the checkbox is selected. boolean false
disabled Disable checkbox boolean false
indeterminate indeterminate checked state of checkbox boolean false
value value of checkbox in CheckboxGroup boolean | string | number -

events

Events Name Description Arguments Version
change The callback function that is triggered when the state changes. Function(e:Event)

Checkbox Group

Property Description Type Default Version
disabled Disable all checkboxes boolean false
name The name property of all input[type="checkbox"] children string - 1.5.0
options Specifies options, you can customize label with slot = "label" slot-scope="option" string[] | Array<{ label: string value: string disabled?: boolean, indeterminate?: boolean, onChange?: function }> []
value(v-model) Used for setting the currently selected value. string[] []

events

Events Name Description Arguments Version
change The callback function that is triggered when the state changes. Function(checkedValue)

Methods

Checkbox

Name Description Version
blur() remove focus
focus() get focus