naive-ui/demo/documentation/components/autoComplete/enUS/index.md

50 lines
1.0 KiB
Markdown
Raw Normal View History

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
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
|-|-|-|
|input|`(value: string \| null)`||
|select|`(value: string)`||