增加 Field 组件 focus 属性 (#135)

This commit is contained in:
Yao 2018-02-26 17:48:07 +08:00 committed by GitHub
parent db20736797
commit 206d44252f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,7 @@ module.exports = {
// 基础类型输入框配置
base: {
name: {
focus: true,
title: '收货人',
placeholder: '名字'
},

View File

@ -59,6 +59,7 @@ Page(extend({}, Field, {
| type | 输入框的类型,可选值为 input, textarea | String | input | |
| inputType | 输入框为 input 情况下输入框的类型例如number, text, password | String | text | |
| placeholder | 输入框为空时占位符 | String | | |
| focus | 自动聚焦,拉起键盘 | Boolean | false | |
| mode | 输入框展示样式,可选值为 wrapped, normal | String | normal | |
| right | 输入框内容是否居右显示 | Boolean | false | |
| error | 是否显示为输入框错误情况下的样式 | Boolean | false | |

View File

@ -8,6 +8,7 @@
auto-height
name="{{ name || componentId || '' }}"
value="{{ value }}"
focus="{{ focus }}"
placeholder="{{ placeholder }}"
class="zan-field__input zan-cell__bd {{ right ? 'zan-field__input--right' : '' }}"
placeholder-class="zan-field__placeholder"
@ -20,6 +21,7 @@
type="{{ inputType || 'text' }}"
name="{{ name || componentId || '' }}"
value="{{ value }}"
focus="{{ focus }}"
placeholder="{{ placeholder }}"
class="zan-field__input zan-cell__bd {{ right ? 'zan-field__input--right' : '' }}"
placeholder-class="zan-field__placeholder"