Yao 9c05bd2d58
[new feature] Field: 增加 value 传入支持 (#60)
* field 支持 value 传入

* textarea 清除输入示例
2017-11-17 21:13:35 +08:00

26 lines
998 B
Plaintext

<template name="zan-field">
<view class="zan-cell zan-field {{ error ? 'zan-field--error' : '' }} {{ mode === 'wrapped' ? 'zan-field--wrapped' : '' }}">
<view
wx:if="{{ title }}"
class="zan-cell__hd zan-field__title">{{ title }}</view>
<textarea
wx:if="{{ type === 'textarea' }}"
auto-height
value="{{ value }}"
placeholder="{{ placeholder }}"
class="zan-field__input zan-cell__bd {{ right ? 'zan-field__input--right' : '' }}"
placeholder-class="zan-field__placeholder"
bindinput="_handleZanFieldChange"
data-component-id="{{ componentId }}"></textarea>
<input
wx:else
type="{{ inputType || 'text' }}"
value="{{ value }}"
placeholder="{{ placeholder }}"
class="zan-field__input zan-cell__bd {{ right ? 'zan-field__input--right' : '' }}"
placeholder-class="zan-field__placeholder"
bindinput="_handleZanFieldChange"
data-component-id="{{ componentId }}"/>
</view>
</template>