types(Checkbox): add CheckboxInstance type (#9140)

This commit is contained in:
neverland
2021-07-28 17:37:08 +08:00
committed by GitHub
parent 51b7a66913
commit 4dd03edf76
4 changed files with 60 additions and 5 deletions
+13
View File
@@ -327,6 +327,19 @@ Use [ref](https://v3.vuejs.org/guide/component-template-refs.html) to get Checkb
| ------ | ------------------- | ------------------- | ------------ |
| toggle | Toggle check status | _checked?: boolean_ | - |
### Types
Get the type definition of the Checkbox instance through `CheckboxInstance`.
```ts
import { ref } from 'vue';
import type { CheckboxInstance } from 'vant';
const checkboxRef = ref<CheckboxInstance>();
checkboxRef.value?.toggle();
```
### CSS Variables
The component provides the following CSS variables, which can be used to customize styles. Please refer to [ConfigProvider component](#/en-US/config-provider).