index.wxml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <wxs src="../wxs/utils.wxs" module="utils" />
  2. <view
  3. class="custom-class {{ utils.bem('cell', [size, { center, required, borderless: !border, clickable: isLink || clickable }]) }}"
  4. hover-class="van-cell--hover hover-class"
  5. hover-stay-time="70"
  6. style="{{ customStyle }}"
  7. bind:tap="onClick"
  8. >
  9. <van-icon
  10. wx:if="{{ icon }}"
  11. name="{{ icon }}"
  12. class="van-cell__left-icon-wrap"
  13. custom-class="van-cell__left-icon"
  14. />
  15. <slot wx:else name="icon" />
  16. <view
  17. style="{{ titleWidth ? 'max-width:' + titleWidth + ';min-width:' + titleWidth : '' }}"
  18. class="van-cell__title title-class"
  19. >
  20. <block wx:if="{{ title }}">{{ title }}</block>
  21. <slot wx:else name="title" />
  22. <view wx:if="{{ label || useLabelSlot }}" class="van-cell__label label-class">
  23. <slot wx:if="{{ useLabelSlot }}" name="label" />
  24. <block wx:elif="{{ label }}">{{ label }}</block>
  25. </view>
  26. </view>
  27. <view class="van-cell__value value-class">
  28. <block wx:if="{{ value || value === 0 }}">{{ value }}</block>
  29. <slot wx:else />
  30. </view>
  31. <van-icon
  32. wx:if="{{ isLink }}"
  33. name="{{ arrowDirection ? 'arrow' + '-' + arrowDirection : 'arrow' }}"
  34. class="van-cell__right-icon-wrap right-icon-class"
  35. custom-class="van-cell__right-icon"
  36. />
  37. <slot wx:else name="right-icon" />
  38. <slot name="extra" />
  39. </view>