grid-item.wxml 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. <view
  2. class="{{classPrefix}} {{prefix}}-class"
  3. style="{{ gridItemStyle }}"
  4. hover-class="{{hover ? classPrefix + '--hover':''}}"
  5. hover-stay-time="{{200}}"
  6. bindtap="onClick"
  7. >
  8. <view
  9. class="{{classPrefix}}__wrapper {{layout==='horizontal' ? classPrefix + '--horizontal' : ''}}"
  10. style="{{gridItemWrapperStyle}}"
  11. >
  12. <view
  13. class="{{classPrefix}}__content {{classPrefix + '--' + (align === 'center' ? 'center' : 'left')}} {{prefix}}-class-content"
  14. style="{{gridItemContentStyle}}"
  15. >
  16. <slot />
  17. <view class="{{classPrefix}}__image {{prefix}}-class-image">
  18. <t-image wx:if="{{image && image !== 'slot'}}" src="{{image}}" mode="widthFix" t-class="external-class" />
  19. <slot wx:else name="image"></slot>
  20. </view>
  21. <view class="{{classPrefix}}__words">
  22. <view wx:if="{{text && text !== 'slot'}}" class="{{classPrefix}}__text {{prefix}}-class-text"> {{text}} </view>
  23. <slot wx:else name="text" class="{{prefix}}-class-text"></slot>
  24. <view
  25. wx:if="{{description && description!== 'slot'}}"
  26. class="{{classPrefix}}__description {{prefix}}-class-description"
  27. >
  28. {{description}}
  29. </view>
  30. <slot wx:else name="description" class="{{prefix}}-class-description"></slot>
  31. </view>
  32. </view>
  33. </view>
  34. </view>