[new feature] Field: add new prop size

support #1350
This commit is contained in:
rex 2019-03-04 10:01:17 +08:00 committed by GitHub
parent bf28ffc9db
commit 83dc420112
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 16 deletions

View File

@ -11,6 +11,7 @@
label="用户名" label="用户名"
placeholder="请输入用户名" placeholder="请输入用户名"
clearable clearable
size="large"
icon="question-o" icon="question-o"
icon-class="icon" icon-class="icon"
required required

View File

@ -138,6 +138,7 @@ Page({
|-----------|-----------|-----------|-------------|-------------| |-----------|-----------|-----------|-------------|-------------|
| name | 在表单内提交时的标识符 | `String` | - | | name | 在表单内提交时的标识符 | `String` | - |
| label | 输入框左侧文本 | `String` | - | | label | 输入框左侧文本 | `String` | - |
| size | 单元格大小,可选值为 `large` | `String` | - |
| value | 当前输入的值 | `String | Number` | - | | value | 当前输入的值 | `String | Number` | - |
| type | 可设置为任意原生类型, 如 `number` `idcard` `textarea` `digit` | `String` | `text` | | type | 可设置为任意原生类型, 如 `number` `idcard` `textarea` `digit` | `String` | `text` |
| fixed | 如果 type 为 `textarea` 且在一个 `position:fixed` 的区域,需要显示指定属性 fixed 为 true | `Boolean` | `false` | | fixed | 如果 type 为 `textarea` 且在一个 `position:fixed` 的区域,需要显示指定属性 fixed 为 true | `Boolean` | `false` |
@ -193,19 +194,3 @@ Page({
|-----------|-----------| |-----------|-----------|
| input-class | 输入框样式类 | | input-class | 输入框样式类 |
| icon-class | 右侧图标样式类 | | icon-class | 右侧图标样式类 |
### 更新日志
| 版本 | 类型 | 内容 |
|-----------|-----------|-----------|
| 0.0.1 | feature | 新增组件 |
| 0.1.1 | bugfix | 修复在 form 组件内无法获取值的问题 |
| 0.1.1 | bugfix | 修复 icon 插槽无法使用的问题 |
| 0.2.0 | feature | 新增 name 属性 |
| 0.2.1 | feature | 新增 title-width 属性 |
| 0.3.0 | bugfix | 修复 title 宽度错误的问题 |
| 0.3.2 | bugfix | 修复展示清除按钮时导致输入框高度变化的问题 |
| 0.3.3 | bugfix | 修复边框长度溢出的问题 |
| 0.3.3 | bugfix | 修复 input-align 属性不生效的问题 |
| 0.3.6 | bugfix | 修复 readonly 属性不生效的问题 |
| 0.3.6 | feature | 新增 placeholder-style 属性 |

View File

@ -6,6 +6,7 @@ VantComponent({
classes: ['input-class'], classes: ['input-class'],
props: { props: {
size: String,
icon: String, icon: String,
label: String, label: String,
error: Boolean, error: Boolean,

View File

@ -10,6 +10,7 @@
custom-style="{{ customStyle }}" custom-style="{{ customStyle }}"
title-width="{{ titleWidth }}" title-width="{{ titleWidth }}"
custom-class="van-field" custom-class="van-field"
size="{{ size }}"
> >
<slot name="left-icon" slot="icon" /> <slot name="left-icon" slot="icon" />
<slot name="label" slot="title" /> <slot name="label" slot="title" />