2019-11-22 16:58:13 +08:00
|
|
|
# Auto Complete
|
2020-01-28 14:11:09 +08:00
|
|
|
Use as search hint or something similar.
|
|
|
|
## Demos
|
2019-11-22 16:58:13 +08:00
|
|
|
```demo
|
|
|
|
basic
|
2019-12-04 17:59:38 +08:00
|
|
|
custom-input
|
|
|
|
after-select
|
2020-01-28 14:11:09 +08:00
|
|
|
```
|
|
|
|
## V-model
|
|
|
|
|Prop|Event|
|
|
|
|
|-|-|
|
|
|
|
|value|input|
|
|
|
|
|
|
|
|
## Props
|
|
|
|
|Name|Type|Default|Description|
|
|
|
|
|-|-|-|-|
|
|
|
|
|size|`'small' \| 'medium' \| 'large'`|`'medium'`||
|
|
|
|
|value|`string`|`null`||
|
2020-02-04 10:44:04 +08:00
|
|
|
|options|`Array<AutoCompleteOption \| AutoCompleteOptionGroup>`|`[]`||
|
2020-02-04 10:45:22 +08:00
|
|
|
|placeholder|`string`|`null`||
|
2020-01-28 14:11:09 +08:00
|
|
|
|blur-after-select|`boolean`|`false`||
|
|
|
|
|clear-after-select|`boolean`|`false`||
|
|
|
|
|
2020-02-04 10:44:04 +08:00
|
|
|
## API
|
|
|
|
### AutoCompleteOption Type
|
|
|
|
|Property|Type|Description|
|
|
|
|
|-|-|-|
|
|
|
|
|label|`string`||
|
|
|
|
|value|`string \| number`|Should be unique in options.|
|
|
|
|
|disabled|`boolean`||
|
|
|
|
|render|`function`||
|
|
|
|
|
|
|
|
### AutoCompleteOptionGroup Type
|
|
|
|
|Property|Type|Description|
|
|
|
|
|-|-|-|
|
|
|
|
|type|`'group'`||
|
|
|
|
|name|`string`||
|
|
|
|
|children|`Array<AutoCompleteOption>`||
|
|
|
|
|
2020-01-28 14:11:09 +08:00
|
|
|
## Slots
|
|
|
|
|Name|Parameters|Description|
|
|
|
|
|-|-|-|
|
2020-02-05 12:21:18 +08:00
|
|
|
|default|`({ handleInput: (value: string) => any, handleFocus: function, handleBlur: function, value: string })`||
|
2020-01-28 14:11:09 +08:00
|
|
|
|
|
|
|
## Events
|
2020-02-04 10:44:04 +08:00
|
|
|
|Name|Parameters|Description|
|
2020-01-28 14:11:09 +08:00
|
|
|
|-|-|-|
|
2020-01-30 23:54:06 +08:00
|
|
|
|input|`(value: string \| null)`||
|
|
|
|
|select|`(value: string)`||
|