types(DatetimePicker): add DatetimePickerInstance type (#9208)

* types(DatetimePicker): add DatetimePickerInstance type

* chore: fix
This commit is contained in:
neverland
2021-08-08 17:55:03 +08:00
committed by GitHub
parent e544b9ffe1
commit 92c06b2700
7 changed files with 68 additions and 20 deletions
+13
View File
@@ -342,3 +342,16 @@ Use [ref](https://v3.vuejs.org/guide/component-template-refs.html) to get Dateti
| Name | Description | Attribute | Return value |
| --------- | ------------------- | --------- | ------------ |
| getPicker | get Picker instance | - | - |
### Types
Get the type definition of the DatetimePicker instance through `DatetimePickerInstance`.
```ts
import { ref } from 'vue';
import type { DatetimePickerInstance } from 'vant';
const datetimePickerRef = ref<DatetimePickerInstance>();
datetimePickerRef.value?.getPicker();
```