index.wxml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <!-- input/input.wxml -->
  2. <label
  3. class='form-item {{disabled? "disabled": ""}} l-class form-item-{{labelLayout}}'
  4. style="width:{{width}}rpx">
  5. <view class='mask' wx:if="{{disabled}}"></view>
  6. <view class='row' hidden="{{ showRow ? '' : 'hidden' }}" style="width:{{width}}rpx;"></view>
  7. <view wx:if="{{label && !labelCustom}}" hidden="{{hideLabel}}" class='form-label l-label-class form-label-{{labelLayout}}' style='{{labelLayout !== "top" ? "width:"+ labelWidth+ "rpx;" : "" }} height:{{labelLayout== "top" ? labelWidth + "rpx" : "" }}'>
  8. <text><text class='text-require' wx:if="{{required}}">* </text>{{label}}<text wx:if="{{colon}}">:</text>
  9. </text>
  10. </view>
  11. <view wx:else hidden="{{hideLabel}}" class='form-label l-label-class form-label-{{labelLayout}}' style='{{labelLayout !== "top" ? "width:"+ labelWidth+ "rpx;" : "" }} height:{{labelLayout== "top" ? labelWidth + "rpx" : "" }}'>
  12. <slot name="left" />
  13. </view>
  14. <!-- 小程序表单组件 -->
  15. <input
  16. class="input {{hideLabel?'hideLabel':''}}"
  17. value="{{ value }}"
  18. type="{{type}}"
  19. password="{{type==='password'}}"
  20. placeholder="{{placeholder}}"
  21. maxlength="{{maxlength}}"
  22. placeholder-class="pls-class"
  23. placeholder-style="{{placeholderStyle}}"
  24. disabled="{{disabled}}"
  25. focus="{{focus}}"
  26. bindinput="handleInputChange"
  27. bindfocus="handleInputFocus"
  28. bindblur="handleInputBlur"
  29. bindconfirm="handleInputConfirm" />
  30. <view class="close" wx:if="{{clear&&value}}" bindtap="onClearTap">
  31. <view class="close-icon">
  32. <l-icon name="close" color="#fff" size="16" />
  33. </view>
  34. </view>
  35. <slot name="right"/>
  36. <l-error-tip l-error-text-class="l-error-text l-error-text-class" errorText="{{errorText}}" wx:if="{{errorText}}"/>
  37. </label>