types(CheckboxGroup): add CheckboxGroupInstance type (#9142)

This commit is contained in:
neverland
2021-07-28 17:56:25 +08:00
committed by GitHub
parent 4dd03edf76
commit 82bed7711c
4 changed files with 33 additions and 8 deletions
+4 -2
View File
@@ -329,15 +329,17 @@ Use [ref](https://v3.vuejs.org/guide/component-template-refs.html) to get Checkb
### Types
Get the type definition of the Checkbox instance through `CheckboxInstance`.
Get the type definition of the Checkbox instance through `CheckboxInstance` and `CheckboxGroupInstance`.
```ts
import { ref } from 'vue';
import type { CheckboxInstance } from 'vant';
import type { CheckboxInstance, CheckboxGroupInstance } from 'vant';
const checkboxRef = ref<CheckboxInstance>();
const checkboxGroupRef = ref<CheckboxGroupInstance>();
checkboxRef.value?.toggle();
checkboxGroupRef.value?.toggleAll();
```
### CSS Variables