index.wxml 1.2 KB

12345678910111213141516
  1. <van-cell-group>
  2. <van-field wx:for="{{fromList}}" wx:key="{{item.label}}" data-item="{{item}}" data-index="{{index}}" value="{{ item.value }}" label="{{item.label}}" placeholder="{{item.placeholder}}" error='{{item.error}}' required='{{item.required}}' input-align='right' bind:change='inputChange' bind:clear='inputClear' clearable>
  3. <view class="section" wx:if="{{item.type=='date'}}" slot='input'>
  4. <picker mode="date" value="{{item.value}}" end="{{endTime}}" data-index="{{index}}" bindchange="bindDateChange">
  5. <view class="picker" style="color:{{item.error?'var(--field-input-error-text-color,#ee0a24)':'var(--field-input-text-color,#323233)'}}">
  6. <text wx:if="{{item.value==''}}" style="opacity:{{item.error?1:.4}}">请选择</text>
  7. <text wx:else>{{item.value}}</text>
  8. </view>
  9. </picker>
  10. </view>
  11. <slot name='slot1' wx:if="{{item.type=='custom'}}" slot='input' />
  12. <slot name='slot2' wx:if="{{item.type=='custom'}}" slot='input' />
  13. <slot name='slot3' wx:if="{{item.type=='custom'}}" slot='input' />
  14. <slot name='slot4' wx:if="{{item.type=='custom'}}" slot='input' />
  15. </van-field>
  16. </van-cell-group>