[improvement] Field:增加titleWidth属性 (#482)

This commit is contained in:
rex 2018-08-30 21:04:22 +08:00 committed by neverland
parent 852269a272
commit dd488a0e3b
5 changed files with 10 additions and 4 deletions

View File

@ -57,9 +57,9 @@
top: 0; top: 0;
right: 0; right: 0;
padding: 0 15px; padding: 0 15px;
font-size: 18px; font-size: 18px !important;
color: $gray-dark; color: $gray-dark;
position: absolute; position: absolute !important;
line-height: inherit; line-height: inherit !important;
} }
} }

View File

@ -96,6 +96,7 @@
|-----------|-----------|-----------|-------------| |-----------|-----------|-----------|-------------|
| icon | 左侧图标,可选值见 Icon 组件 | `String` | - | | icon | 左侧图标,可选值见 Icon 组件 | `String` | - |
| title | 左侧标题 | `String | Number` | - | | title | 左侧标题 | `String | Number` | - |
| titleWidth | 标题宽度 | `Number` | - |
| value | 右侧内容 | `String | Number` | - | | value | 右侧内容 | `String | Number` | - |
| label | 标题下方的描述信息 | `String` | - | | label | 标题下方的描述信息 | `String` | - |
| border | 是否显示下边框 | `Boolean` | `true` | | border | 是否显示下边框 | `Boolean` | `true` |

View File

@ -133,6 +133,7 @@
| readonly | 是否只读 | `Boolean` | `false` | | readonly | 是否只读 | `Boolean` | `false` |
| clearable | 是否启用清除控件 | `Boolean` | `false` | | clearable | 是否启用清除控件 | `Boolean` | `false` |
| required | 是否显示表单必填星号 | `Boolean` | `false` | | required | 是否显示表单必填星号 | `Boolean` | `false` |
| titleWidth | 标题宽度 | `Number` | `90` |
| maxlength | 最大输入长度,设置为 -1 的时候不限制最大长度 | `Number` | `-1` | | maxlength | 最大输入长度,设置为 -1 的时候不限制最大长度 | `Number` | `-1` |
| placeholder | 输入框为空时占位符 | `String` | - | | placeholder | 输入框为空时占位符 | `String` | - |
| is-link | 是否展示右侧箭头并开启点击反馈 | `Boolean` | `false` | | is-link | 是否展示右侧箭头并开启点击反馈 | `Boolean` | `false` |

View File

@ -53,6 +53,10 @@ Component({
border: { border: {
type: Boolean, type: Boolean,
value: true value: true
},
titleWidth: {
type: Number,
value: 90
} }
}, },

View File

@ -6,7 +6,7 @@
is-link="{{ isLink }}" is-link="{{ isLink }}"
required="{{ required }}" required="{{ required }}"
custom-style="{{ customStyle }}" custom-style="{{ customStyle }}"
title-width="90px" title-width="{{ titleWidth }}"
custom-class="{{ customClass }} van-field {{ labelAlign ? 'van-field--label-' + labelAlign : '' }}" custom-class="{{ customClass }} van-field {{ labelAlign ? 'van-field--label-' + labelAlign : '' }}"
> >
<slot name="label" slot="title" /> <slot name="label" slot="title" />