index.wxml 1.1KB

12345678910111213141516171819202122232425262728
  1. <wxs src="../wxs/utils.wxs" module="utils" />
  2. <wxs src="./index.wxs" module="computed" />
  3. <view
  4. class="custom-class {{ utils.bem('grid-item', { square }) }}"
  5. style="{{ computed.wrapperStyle({ square, gutter, columnNum, index }) }}"
  6. bindtap="onClick"
  7. >
  8. <view
  9. class="content-class {{ utils.bem('grid-item__content', [direction, { center, square, reverse, clickable, surround: border && gutter }]) }} {{ border ? 'van-hairline--surround' : '' }}"
  10. style="{{ computed.contentStyle({ square, gutter }) }}"
  11. >
  12. <block wx:if="{{ useSlot }}">
  13. <slot />
  14. </block>
  15. <block wx:else>
  16. <view class="van-grid-item__icon icon-class">
  17. <van-icon wx:if="{{ icon }}" name="{{ icon }}" color="{{ iconColor }}" class-prefix="{{ iconPrefix }}" dot="{{ dot }}" info="{{ badge || info }}" size="{{ iconSize }}" />
  18. <slot wx:else name="icon"></slot>
  19. </view>
  20. <view class="van-grid-item__text text-class">
  21. <text wx:if="{{ text }}">{{ text }}</text>
  22. <slot wx:else name="text"></slot>
  23. </view>
  24. </block>
  25. </view>
  26. </view>