docs(input): api table (#621)

* docs: add input docs

* Apply suggestions from code review

Co-authored-by: 07akioni <07akioni2@gmail.com>
This commit is contained in:
Yugang Cao 2021-07-23 23:13:05 +08:00 committed by GitHub
parent 9b9ea2b4d6
commit e5e503f328
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 37 deletions

View File

@ -26,54 +26,54 @@ focus
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| autofocus | `boolean` | `false` | |
| autosize | `boolean \| { minRows?: number, maxRows?: number }` | `false` | |
| clearable | `boolean` | `false` | |
| default-value | `string \| [string, string] \| null` | `null` | |
| disabled | `boolean` | `false` | |
| autofocus | `boolean` | `false` | Whether to autofocus. |
| autosize | `boolean \| { minRows?: number, maxRows?: number }` | `false` | When type is textarea works, for example `{ minRows: 1, maxRows: 3 }`. |
| clearable | `boolean` | `false` | Whether the input is clearable. |
| default-value | `string \| [string, string] \| null` | `null` | Default value in uncontrolled mode. |
| disabled | `boolean` | `false` | Whether to disable the input. |
| input-props | `object` | `undefined` | The props of the input element inside the component. It doesn't work with `pair` input. |
| loading | `boolean` | `undefined` | Whether to show loading indicator. Set to non `undefined` value will take space for loading indicator. |
| maxlength | `number` | `undefined` | |
| minlength | `number` | `undefined` | |
| maxlength | `number` | `undefined` | Maximum input length. |
| minlength | `number` | `undefined` | Minimum input length. |
| pair | `boolean` | `false` | Whether to input pairwise value. |
| passively-activated | `boolean` | `false` | |
| passively-activated | `boolean` | `false` | Whether to passively activate the input. |
| placeholder | `string \| [string, string]` | `undefined` | Placeholder of input. When `pair` is `true`, placeholder is an array. |
| readonly | `boolean` | `false` | |
| round | `boolean` | `false` | |
| rows | `number` | `3` | |
| readonly | `boolean` | `false` | Read only. |
| round | `boolean` | `false` | Whether the input show round. |
| rows | `number` | `3` | Input rows, only works when type is `textarea`. |
| separator | `string` | `undefined` | The separator bewteen pairwise inputs. |
| show-count | `boolean` | `false` | Whether to show word count. |
| show-password-toggle | `boolean` | `false` | Controls the display and hiding of passwords |
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | |
| type | `'text' \| 'password' \| 'textarea'` | `'text'` | |
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | Input size. |
| type | `'text' \| 'password' \| 'textarea'` | `'text'` | Input type. |
| value | `string \| [string, string] \| null` | `undefined` | Value of input. When `pair` is `true`, `value` is an array. |
| on-blur | `() => void` | `undefined` | |
| on-change | `(value: string \| [string, string]) => void` | `undefined` | |
| on-clear | `() => void` | `undefined` | |
| on-focus | `() => void` | `undefined` | |
| on-update:value | `(value: string \| [string, string]) => void` | `undefined` | |
| on-blur | `() => void` | `undefined` | Callback triggered when the input blur. |
| on-change | `(value: string \| [string, string]) => void` | `undefined` | Callback triggered when the input blur and value changes. |
| on-clear | `() => void` | `undefined` | Callback triggered when the input clear. |
| on-focus | `() => void` | `undefined` | Callback triggered when the input focus. |
| on-update:value | `(value: string \| [string, string]) => void` | `undefined` | Callback triggered when the input value changes. |
## Slots
### Input Slots
| Name | Parameters | Description |
| --------- | ---------- | ----------- |
| prefix | `()` | |
| suffix | `()` | |
| separator | `()` | |
| Name | Parameters | Description |
| --- | --- | --- |
| prefix | `()` | The prefix content of the input. |
| suffix | `()` | The suffix content of the input. |
| separator | `()` | The separator content of the input, only works when `pare` is true and it's priority higher than the separator prop. |
### Input Group Slots
| Name | Parameters | Description |
| ------- | ---------- | ----------- |
| default | `()` | |
| Name | Parameters | Description |
| ------- | ---------- | ------------------------------- |
| default | `()` | The content of the input group. |
### Input Group Label Slots
| Name | Parameters | Description |
| ------- | ---------- | ----------- |
| default | `()` | |
| Name | Parameters | Description |
| ------- | ---------- | ------------------------------------- |
| default | `()` | The content of the input group label. |
## Methods

View File

@ -26,8 +26,8 @@ focus
| 名称 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| autofocus | `boolean` | `false` | 自动获取焦点 |
| autosize | `boolean \| { minRows?: number, maxRows?: number }` | `false` | 自适应内容高度,只对 type="textarea" 有效,可传入对象,如{ minRows: 1, maxRows: 3 } |
| autofocus | `boolean` | `false` | 是否自动获取焦点 |
| autosize | `boolean \| { minRows?: number, maxRows?: number }` | `false` | 自适应内容高度,只对 type="textarea" 有效,可传入对象,如 { minRows: 1, maxRows: 3 } |
| clearable | `boolean` | `false` | 是否可清空 |
| default-value | `string \| [string, string] \| null` | `null` | 输入框默认值 |
| disabled | `boolean` | `false` | 是否禁用 |
@ -66,15 +66,15 @@ focus
### Input Group Slots
| 属性 | 类型 | 说明 |
| ------- | ---- | ---- |
| default | `()` | |
| 属性 | 类型 | 说明 |
| ------- | ---- | ------------ |
| default | `()` | 输入组的内容 |
### Input Group Label Slots
| 属性 | 类型 | 说明 |
| ------- | ---- | ---- |
| default | `()` | |
| 属性 | 类型 | 说明 |
| ------- | ---- | ---------------- |
| default | `()` | 输入组标签的内容 |
## Methods