types(Form): add FormInstance type (#9139)

* types(Form): add FormInstance type

* types: useExpose type
This commit is contained in:
neverland
2021-07-28 17:20:11 +08:00
committed by GitHub
parent 4705f0be1d
commit 51b7a66913
5 changed files with 50 additions and 4 deletions
+13
View File
@@ -543,6 +543,19 @@ Use [ref](https://v3.vuejs.org/guide/component-template-refs.html) to get Form i
| resetValidation | Reset validation | _name?: string \| string[]_ | - |
| scrollToField | Scroll to field | _name: string, alignToTop: boolean_ | - |
### Types
Get the type definition of the Form instance through `FormInstance`.
```ts
import { ref } from 'vue';
import type { FormInstance } from 'vant';
const formRef = ref<FormInstance>();
formRef.value?.submit();
```
### Slots
| Name | Description |