index.wxml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <wxs src="./index.wxs" module="utils" />
  2. <view wx:if="{{ showHeader }}" class="van-cascader__header">
  3. <text class="van-cascader__title"><slot name="title"></slot>{{ title }}</text>
  4. <van-icon
  5. wx:if="{{ closeable }}"
  6. name="{{ closeIcon }}"
  7. class="van-cascader__close-icon"
  8. bind:tap="onClose"
  9. />
  10. </view>
  11. <van-tabs
  12. active="{{ activeTab }}"
  13. custom-class="van-cascader__tabs"
  14. wrap-class="van-cascader__tabs-wrap"
  15. tab-class="van-cascader__tab"
  16. color="{{ activeColor }}"
  17. border="{{ false }}"
  18. swipeable="{{ swipeable }}"
  19. bind:click="onClickTab"
  20. >
  21. <van-tab
  22. wx:for="{{ tabs }}"
  23. wx:for-item="tab"
  24. wx:for-index="tabIndex"
  25. wx:key="tabIndex"
  26. title="{{ tab.selected ? tab.selected[textKey] : placeholder }}"
  27. style="width: 100%;"
  28. title-style="{{ !tab.selected ? 'color: #969799;font-weight:normal;' : '' }}"
  29. >
  30. <!-- 暂不支持 -->
  31. <!-- <slot name="options-top"></slot> -->
  32. <view class="van-cascader__options">
  33. <view
  34. wx:for="{{ tab.options }}"
  35. wx:for-item="option"
  36. wx:key="index"
  37. class="{{ option.className }} {{ utils.optionClass(tab, textKey, option) }}"
  38. style="{{ utils.optionStyle({ tab, textKey, option, activeColor }) }}"
  39. data-option="{{ option }}"
  40. data-tab-index="{{ tabIndex }}"
  41. bind:tap="onSelect"
  42. >
  43. <text>{{ option[textKey] }}</text>
  44. <van-icon wx:if="{{ utils.isSelected(tab, textKey, option) }}" name="success" size="18" />
  45. </view>
  46. </view>
  47. <!-- 暂不支持 -->
  48. <!-- <slot name="options-bottom"></slot> -->
  49. </van-tab>
  50. </van-tabs>