index.wxml 1.3 KB

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