index.wxml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <template name="zan-field">
  2. <view class="zan-cell zan-field {{ error ? 'zan-field--error' : '' }} {{ mode === 'wrapped' ? 'zan-field--wrapped' : '' }}">
  3. <view
  4. wx:if="{{ title }}"
  5. class="zan-cell__hd zan-field__title">{{ title }}</view>
  6. <textarea
  7. wx:if="{{ type === 'textarea' }}"
  8. auto-height
  9. name="{{ name || componentId || '' }}"
  10. disabled="{{ disabled }}"
  11. focus="{{ focus }}"
  12. value="{{ value }}"
  13. placeholder="{{ placeholder }}"
  14. class="zan-field__input zan-cell__bd {{ right ? 'zan-field__input--right' : '' }}"
  15. placeholder-class="zan-field__placeholder"
  16. bindinput="_handleZanFieldChange"
  17. bindfocus="_handleZanFieldFocus"
  18. bindblur="_handleZanFieldBlur"
  19. data-component-id="{{ componentId || '' }}"></textarea>
  20. <input
  21. wx:else
  22. type="{{ inputType || 'text' }}"
  23. name="{{ name || componentId || '' }}"
  24. disabled="{{ disabled }}"
  25. focus="{{ focus }}"
  26. value="{{ value }}"
  27. placeholder="{{ placeholder }}"
  28. class="zan-field__input zan-cell__bd {{ right ? 'zan-field__input--right' : '' }}"
  29. placeholder-class="zan-field__placeholder"
  30. bindinput="_handleZanFieldChange"
  31. bindfocus="_handleZanFieldFocus"
  32. bindblur="_handleZanFieldBlur"
  33. data-component-id="{{ componentId || '' }}"/>
  34. </view>
  35. </template>