diff --git a/apps/docs/src/data/components/formCheckbox.data.ts b/apps/docs/src/data/components/formCheckbox.data.ts index 7f531aed1..b024e707e 100644 --- a/apps/docs/src/data/components/formCheckbox.data.ts +++ b/apps/docs/src/data/components/formCheckbox.data.ts @@ -23,7 +23,9 @@ export default { { prop: 'indeterminate', type: 'Booleanish', - default: undefined, + default: false, + description: + 'Set to true to show the checkbox as indeterminate, false to show its normal checked/unchecked.', }, { prop: 'name', @@ -108,35 +110,38 @@ export default { ], emits: [ { + event: 'update:modelValue', + description: 'Emitted when the checked value is changed', args: [ { - arg: 'update:modelValue', - description: '', - type: 'unknown', + arg: 'checked', + description: + 'Value of the checkbox. Value will be an array for grouped checkboxes or a single value for standalone checkboxes.', + type: 'CheckboxValue | readonly CheckboxValue[]', }, ], - description: '', - event: 'update:modelValue', }, { event: 'input', - description: '', + description: 'Emitted before the checked value is changed', args: [ { - arg: 'input', - description: '', - type: 'unknown', + arg: 'checked', + description: + 'Value of the checkbox before the event. Value will be an array for grouped checkboxes or a single value for standalone checkboxes.', + type: 'CheckboxValue | readonly CheckboxValue[]', }, ], }, { event: 'change', - description: '', + description: 'Emitted when the checked value is changed', args: [ { - arg: 'change', - description: '', - type: 'unknown', + arg: 'checked', + description: + 'Value of the checkbox. Value will be an array for grouped checkboxes or a single value for standalone checkboxes.', + type: 'CheckboxValue | readonly CheckboxValue[]', }, ], }, diff --git a/apps/docs/src/docs/components/form-checkbox.md b/apps/docs/src/docs/components/form-checkbox.md index 162ea54b9..22e8ad888 100644 --- a/apps/docs/src/docs/components/form-checkbox.md +++ b/apps/docs/src/docs/components/form-checkbox.md @@ -719,22 +719,35 @@ Visually, there are actually three states a checkbox can be in: checked, uncheck The indeterminate state is **visual only**. The checkbox is still either checked or unchecked as a value. That means the visual indeterminate state masks the real value of the checkbox, so that better make sense in your UI!. -`BFormCheckbox` supports setting this visual indeterminate state via the indeterminate prop (defaults to false). Clicking the checkbox will clear its indeterminate state. +`BFormCheckbox` supports setting this visual indeterminate state via a secondary named model called indeterminate (defaults to undefined). Clicking the checkbox will clear the indeterminate state and emit an `update:indeterminate=false` event. To reset the state set the indeterminate model value to true. - Click me to see what happens + Click me to see what happens + Reset Indeterminate
- Checked: {{ intermChecked }} + Checked: {{ intermChecked }}
+ Indeterminate: {{ indeterminate }}