types(Form): add FormInstance type (#9139)
* types(Form): add FormInstance type * types: useExpose type
This commit is contained in:
@@ -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 |
|
||||
|
||||
Reference in New Issue
Block a user