action-sheet-grid.wxml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <import src="./action-sheet-item.wxml" />
  2. <template name="grid">
  3. <block wx:if="{{gridThemeItems.length === 1}}">
  4. <t-grid align="center" t-class="{{classPrefix}}__grid" column="{{count / 2}}" class="{{classPrefix}}__single-wrap">
  5. <t-grid-item
  6. t-class="{{classPrefix}}__grid-item"
  7. class="{{classPrefix}}__square"
  8. wx:for="{{gridThemeItems[0]}}"
  9. wx:key="index"
  10. bind:tap="onSelect"
  11. data-index="{{index}}"
  12. >
  13. <template is="item" data="{{classPrefix, item}}" />
  14. </t-grid-item>
  15. </t-grid>
  16. </block>
  17. <block wx:elif="{{gridThemeItems.length > 1}}">
  18. <view class="{{classPrefix}}__swiper-wrap">
  19. <t-swiper height="{{456}}" autoplay="{{false}}" current="{{currentSwiperIndex}}" bindchange="onSwiperChange">
  20. <t-swiper-item wx:for="{{gridThemeItems}}" wx:key="index">
  21. <t-grid align="center" t-class="{{classPrefix}}__grid" column="{{count / 2}}">
  22. <t-grid-item
  23. t-class="{{classPrefix}}__grid-item"
  24. class="{{classPrefix}}__square"
  25. wx:for="{{item}}"
  26. wx:key="index"
  27. data-index="{{index}}"
  28. bind:tap="onSelect"
  29. >
  30. <template is="item" data="{{classPrefix, item}}" />
  31. </t-grid-item>
  32. </t-grid>
  33. </t-swiper-item>
  34. </t-swiper>
  35. <view class="{{classPrefix}}__nav">
  36. <view class="{{classPrefix}}__dots">
  37. <view
  38. wx:for="{{gridThemeItems.length}}"
  39. wx:key="index"
  40. class="{{classPrefix}}__dots-item {{index === currentSwiperIndex ? prefix + '-is-active' : ''}}"
  41. />
  42. </view>
  43. </view>
  44. </view>
  45. </block>
  46. </template>