index.wxml 909 B

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