index.wxml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <wxs src="../wxs/utils.wxs" module="utils" />
  2. <wxs src="./index.wxs" module="wxs" />
  3. <view
  4. class="van-tree-select"
  5. style="height: {{ innerHeight }}"
  6. >
  7. <scroll-view scroll-y class="van-tree-select__nav">
  8. <van-sidebar active-key="{{ mainActiveIndex }}" bind:change="onClickNav" custom-class="van-tree-select__nav__inner">
  9. <van-sidebar-item
  10. wx:for="{{ items }}"
  11. wx:key="index"
  12. custom-class="main-item-class"
  13. active-class="main-active-class"
  14. disabled-class="main-disabled-class"
  15. title="{{ item.text }}"
  16. disabled="{{ item.disabled }}"
  17. />
  18. </van-sidebar>
  19. </scroll-view>
  20. <scroll-view scroll-y class="van-tree-select__content">
  21. <slot name="content" />
  22. <view
  23. wx:for="{{ subItems }}"
  24. wx:key="id"
  25. class="van-ellipsis content-item-class {{ utils.bem('tree-select__item', { active: wxs.isActive(activeId, item.id), disabled: item.disabled }) }} {{ wxs.isActive(activeId, item.id) ? 'content-active-class' : '' }} {{ item.disabled ? 'content-disabled-class' : '' }}"
  26. data-item="{{ item }}"
  27. bind:tap="onSelectItem"
  28. >
  29. {{ item.text }}
  30. <van-icon
  31. wx:if="{{ wxs.isActive(activeId, item.id) }}"
  32. name="checked"
  33. size="16px"
  34. class="van-tree-select__selected"
  35. />
  36. </view>
  37. </scroll-view>
  38. </view>