feat(CheckboxGroup): toggleAll support skipDisabled option (#7644)

This commit is contained in:
neverland
2020-11-26 19:34:51 +08:00
committed by GitHub
parent 9f2187f021
commit 488d90aab9
5 changed files with 78 additions and 16 deletions
+24 -1
View File
@@ -259,7 +259,30 @@ Use [ref](https://vuejs.org/v2/api/#ref) to get CheckboxGroup instance and call
| Name | Description | Attribute | Return value |
| --- | --- | --- | --- |
| toggleAll | Toggle check status of all checkboxes | _checked?: boolean_ | - |
| toggleAll | Toggle check status of all checkboxes | _options?: boolean \| object_ | - |
### toggleAll Usage
```js
const { checkboxGroup } = this.$refs;
// Toggle all
checkboxGroup.toggleAll();
// Select all
checkboxGroup.toggleAll(true);
// Unselect all
checkboxGroup.toggleAll(false);
// Toggle all, skip disabled
checkboxGroup.toggleAll({
skipDisabled: true,
});
// Select all, skip disabled
checkboxGroup.toggleAll({
checked: true,
skipDisabled: true,
});
```
### Checkbox Methods