feat(Field): add arrow-direction prop (#1948)

This commit is contained in:
neverland 2019-09-04 10:40:39 +08:00 committed by GitHub
parent 982dcd7a88
commit 22ad214714
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 21 deletions

View File

@ -27,6 +27,7 @@
##### Field ##### Field
- 新增`clickable`属性 - 新增`clickable`属性
- 新增`arrow-direction`属性
##### Popup ##### Popup

View File

@ -16,20 +16,5 @@ Page({
icon: 'none', icon: 'none',
title: '点击图标' title: '点击图标'
}); });
},
onFieldChange({ detail }) {
console.log('change', detail);
this.setData({
sms: detail
});
},
onFieldBlur({ detail }) {
console.log('blur', detail);
},
onSendSms() {
console.log('onSendSms', this.data.sms);
} }
}); });

View File

@ -81,10 +81,8 @@
placeholder="请输入短信验证码" placeholder="请输入短信验证码"
use-button-slot use-button-slot
border="{{ false }}" border="{{ false }}"
bind:change="onFieldChange"
bind:blur="onFieldBlur"
> >
<van-button slot="button" size="small" type="primary" custom-class="button" bind:tap="onSendSms">发送验证码</van-button> <van-button slot="button" size="small" type="primary" custom-class="button">发送验证码</van-button>
</van-field> </van-field>
</van-cell-group> </van-cell-group>
</demo-block> </demo-block>

View File

@ -185,6 +185,7 @@ Page({
| placeholder-style | 指定 placeholder 的样式 | *string* | - | | placeholder-style | 指定 placeholder 的样式 | *string* | - |
| custom-style | 自定义样式 | *string* | - | | custom-style | 自定义样式 | *string* | - |
| is-link | 是否展示右侧箭头并开启点击反馈 | *boolean* | `false` | | is-link | 是否展示右侧箭头并开启点击反馈 | *boolean* | `false` |
| arrow-direction | 箭头方向,可选值为 `left` `up` `down` | *string* | - |
| error | 是否将输入内容标红 | *boolean* | `false` | | error | 是否将输入内容标红 | *boolean* | `false` |
| error-message | 底部错误提示文案,为空时不展示 | *string* | `''` | | error-message | 底部错误提示文案,为空时不展示 | *string* | `''` |
| error-message-align | 底部错误提示文案对齐方式,可选值为 `center` `right` | *string* | `''` | | error-message-align | 底部错误提示文案对齐方式,可选值为 `center` `right` | *string* | `''` |

View File

@ -27,11 +27,12 @@ VantComponent({
clearable: Boolean, clearable: Boolean,
clickable: Boolean, clickable: Boolean,
inputAlign: String, inputAlign: String,
placeholder: String,
customStyle: String, customStyle: String,
confirmType: String, confirmType: String,
confirmHold: Boolean, confirmHold: Boolean,
errorMessage: String, errorMessage: String,
placeholder: String, arrowDirection: String,
placeholderStyle: String, placeholderStyle: String,
errorMessageAlign: String, errorMessageAlign: String,
selectionEnd: { selectionEnd: {

View File

@ -1,6 +1,7 @@
<wxs src="../wxs/utils.wxs" module="utils" /> <wxs src="../wxs/utils.wxs" module="utils" />
<van-cell <van-cell
size="{{ size }}"
icon="{{ leftIcon }}" icon="{{ leftIcon }}"
title="{{ label }}" title="{{ label }}"
center="{{ center }}" center="{{ center }}"
@ -8,10 +9,10 @@
is-link="{{ isLink }}" is-link="{{ isLink }}"
required="{{ required }}" required="{{ required }}"
clickable="{{ clickable }}" clickable="{{ clickable }}"
custom-style="{{ customStyle }}"
title-width="{{ titleWidth }}" title-width="{{ titleWidth }}"
custom-style="{{ customStyle }}"
arrow-direction="{{ arrowDirection }}"
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" />