index.wxml 1.7 KB

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