types: add CalendarInstance type (#9165)

* types: add CalendarInstance type

* types: fix
This commit is contained in:
neverland
2021-08-02 17:43:12 +08:00
committed by GitHub
parent 1b5c166824
commit 5f41cb9bbd
8 changed files with 144 additions and 93 deletions
+13
View File
@@ -347,6 +347,19 @@ Use [ref](https://v3.vuejs.org/guide/component-template-refs.html) to get Calend
| reset | Reset selected date, will reset to default date when no params passed | _date?: Date \| Date[]_ | - |
| scrollToDate | Scroll to date | _date: Date_ | - |
### Types
Get the type definition of the Calendar instance through `CalendarInstance`.
```ts
import { ref } from 'vue';
import type { CalendarInstance } from 'vant';
const calendarRef = ref<CalendarInstance>();
calendarRef.value?.reset();
```
### 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).