Yao 876c75a388
[improvement] Field: 优化在列表中输入框表现 (#296)
* 优化 field 实现

* field 使用cell来架构

* field 列表
2018-06-04 21:52:32 +08:00

40 lines
1.2 KiB
Plaintext

<zan-cell
class="field-class zan-field {{ error ? 'zan-field--error' : '' }} {{ mode === 'wrapped' ? 'zan-field--wrapped' : '' }} {{ !showBorder ? 'zan-field--no-border' : '' }}"
cell-class="zan-cell--field"
>
<view
slot="icon"
wx:if="{{ title }}"
class="zan-cell__hd zan-field__title">
{{ title }}
</view>
<textarea
wx:if="{{ type === 'textarea' }}"
auto-height
disabled="{{ disabled }}"
focus="{{ focus }}"
value="{{ value }}"
placeholder="{{ placeholder }}"
maxlength="{{ maxlength }}"
class="zan-field__input zan-cell__bd {{ right ? 'zan-field__input--right' : '' }}"
placeholder-class="zan-field__placeholder"
bindinput="handleFieldChange"
bindfocus="handleFieldFocus"
bindblur="handleFieldBlur"
></textarea>
<input
wx:else
type="{{ inputType || 'text' }}"
disabled="{{ disabled }}"
focus="{{ focus }}"
value="{{ value }}"
placeholder="{{ placeholder }}"
maxlength="{{ maxlength }}"
class="zan-field__input zan-cell__bd {{ right ? 'zan-field__input--right' : '' }}"
placeholder-class="zan-field__placeholder"
bindinput="handleFieldChange"
bindfocus="handleFieldFocus"
bindblur="handleFieldBlur"
/>
</zan-cell>