cell.wxml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <import src="../common/template/icon.wxml" />
  2. <wxs src="../common/utils.wxs" module="_" />
  3. <view
  4. style="{{_._style([style, customStyle])}}"
  5. class="class {{prefix}}-class {{_.cls(classPrefix, [['borderless', !bordered || isLastChild]])}}"
  6. hover-class="{{ hover ? classPrefix + '--hover' : ''}}"
  7. hover-stay-time="70"
  8. bind:tap="onClick"
  9. aria-role="{{ariaRole || (arrow ? 'button' : '')}}"
  10. aria-label="{{ariaLabel}}"
  11. >
  12. <view class="{{classPrefix}}__left {{prefix}}-class-left">
  13. <template
  14. wx:if="{{_leftIcon}}"
  15. is="icon"
  16. data="{{tClass: classPrefix + '__left-icon ' + prefix + '-class-left-icon', ..._leftIcon }}"
  17. />
  18. <slot name="left-icon" />
  19. <t-image
  20. wx:if="{{ image }}"
  21. shape="round"
  22. t-class="{{classPrefix}}__left-image {{prefix}}-class-image"
  23. src="{{ image }}"
  24. />
  25. <slot name="image" />
  26. </view>
  27. <view class="{{classPrefix}}__title {{prefix}}-class-center">
  28. <view class="{{classPrefix}}__title-text {{prefix}}-class-title">
  29. <block wx:if="{{ title }}"> {{ title}} </block>
  30. <slot name="title" />
  31. <block wx:if="{{required}}">
  32. <text decode class="{{classPrefix}}--required">&nbsp;*</text>
  33. </block>
  34. </view>
  35. <view class="{{classPrefix}}__description {{prefix}}-class-description">
  36. <view wx:if="{{ description }}" class="{{classPrefix}}__description-text">{{description}}</view>
  37. <slot name="description" />
  38. </view>
  39. </view>
  40. <view class="{{classPrefix}}__note {{prefix}}-class-note">
  41. <text wx:if="{{ note }}">{{note}}</text>
  42. <slot name="note" />
  43. </view>
  44. <view class="{{_.cls(classPrefix + '__right', [align])}} {{prefix}}-class-right">
  45. <template
  46. wx:if="{{_arrow}}"
  47. is="icon"
  48. data="{{tClass: classPrefix + '__right-icon ' + prefix + '-class-right-icon', ..._arrow }}"
  49. />
  50. <block wx:else>
  51. <template
  52. wx:if="{{_rightIcon}}"
  53. is="icon"
  54. data="{{tClass: classPrefix + '__right-icon ' + prefix + '-class-right-icon', ..._rightIcon }}"
  55. />
  56. <slot name="right-icon" />
  57. </block>
  58. </view>
  59. </view>