naive-ui/demo/documentation/components/input/enUS/index.demo-entry.md

65 lines
1.8 KiB
Markdown
Raw Normal View History

2019-10-10 14:30:36 +08:00
# Input
2020-01-28 22:26:54 +08:00
Many years ago, people used punched card to input.
2020-10-22 12:12:11 +08:00
<n-alert title="Caveat" type="warning">`n-input` is a controlled component. If you don't update its `value` its value will never change. (`v-model:value` doesn't matter.)</n-alert>
2020-01-28 22:26:54 +08:00
## Demos
2019-10-10 14:30:36 +08:00
```demo
basic
size
round
icon
password
disabled
clearable
autosize
pair
2020-02-09 19:34:14 +08:00
input-group
passively-activated
2020-01-28 22:26:54 +08:00
```
## Props
2020-02-09 19:34:14 +08:00
### Input Props
2020-01-28 22:26:54 +08:00
|Name|Type|Default|Description|
|-|-|-|-|
2020-10-22 12:12:11 +08:00
|autofocus|`boolean`|`false`||
|autosize|`boolean \| { minRows?: number, maxRows?: number }`|`false`||
|clearable|`boolean`|`false`||
2020-01-28 22:26:54 +08:00
|disabled|`boolean`|`false`||
|maxlength|`number`|`undefined`||
|minlength|`number`|`undefined`||
2020-10-22 12:12:11 +08:00
|pair|`boolean`|`false`|Whether to input pairwise value.|
|passively-activated|`boolean`|`false`||
|placeholder|`string \| [string, string]`|`undefined`|Placeholder of input. When `pair` is `true`, placeholder is an array.|
2020-01-28 22:26:54 +08:00
|readonly|`boolean`|`false`||
2020-10-22 12:12:11 +08:00
|round|`boolean`|`false`||
|rows|`number`|`3`||
|separator|`string`|`undefined`|The separator bewteen pairwise inputs.|
2020-10-22 12:12:11 +08:00
|size|`'small' \| 'medium' \| 'large'`|`'medium'`||
|theme|`'light' \| 'dark' \| string`|`undefined`||
2020-10-22 12:12:11 +08:00
|type|`'text' \| 'password' \| 'textarea'`|`'text'`||
|value|`string \| [string, string]`|`null`|Value of input. When `pair` is `true`, `value` is an array.|
|on-blur|`() => any`|`undefined`||
|on-change|`(value: string \| [string, string]) => any`|`undefined`||
|on-clear|`() => any`|`undefined`||
|on-focus|`() => any`|`undefined`||
|on-update:value|`(value: string \| [string, string]) => any`|`undefined`||
2020-01-28 22:26:54 +08:00
## Slots
2020-02-09 19:34:14 +08:00
### Input Slots
2020-01-28 22:26:54 +08:00
|Name|Parameters|Description|
|-|-|-|
|prefix|`()`||
2020-01-28 22:26:54 +08:00
|suffix|`()`||
2020-02-09 19:34:14 +08:00
### Input Group Slots
|Name|Parameters|Description|
|-|-|-|
|default|`()`||
### Input Group Label Slots
|Name|Parameters|Description|
|-|-|-|
|default|`()`||