types(Search): add SearchInstance type (#9181)

This commit is contained in:
neverland
2021-08-04 16:12:45 +08:00
committed by GitHub
parent 5d369072fe
commit 76de1680b1
5 changed files with 67 additions and 25 deletions
+13
View File
@@ -160,6 +160,19 @@ Use [ref](https://v3.vuejs.org/guide/component-template-refs.html) to get Search
| focus | Trigger input focus | - | - |
| blur | Trigger input blur | - | - |
### Types
Get the type definition of the Search instance through `SearchInstance`.
```ts
import { ref } from 'vue';
import type { SearchInstance } from 'vant';
const searchRef = ref<SearchInstance>();
searchRef.value?.focus();
```
### Slots
| Name | Description |