vant-weapp/dist/field/index.wxml
Yao b05249d96a [breaking change] Field & Form: 新增 Field 组件 (#37)
* add input

* remove file

* 更名为 field 组件 && 增加圆角主题

* 调整 field title 宽度

* 增加 input 回调逻辑

* remove form
2017-10-26 16:03:02 +08:00

22 lines
848 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
placeholder="{{ placeholder }}"
class="zan-field__input zan-cell__bd {{ right ? 'zan-field__input--right' : '' }}"
bindinput="_handleZanFieldChange"
data-component-id="{{ componentId }}"></textarea>
<input
wx:else
type="{{ inputType || 'text' }}"
placeholder="{{ placeholder }}"
class="zan-field__input zan-cell__bd {{ right ? 'zan-field__input--right' : '' }}"
bindinput="_handleZanFieldChange"
data-component-id="{{ componentId }}"/>
</view>
</template>