dropdown-menu.wxml 970 B

12345678910111213141516171819202122232425262728
  1. <import src="../common/template/icon.wxml" />
  2. <wxs src="../common/utils.wxs" module="_" />
  3. <view
  4. style="{{_._style([style, customStyle])}}"
  5. class="{{ classPrefix }} class {{prefix}}-class"
  6. id="t-bar"
  7. catchtouchmove="{{activeIdx === -1?'':'noop'}}"
  8. >
  9. <view
  10. wx:for="{{menus}}"
  11. wx:key="index"
  12. bindtap="handleToggle"
  13. data-index="{{index}}"
  14. class="{{_.cls(classPrefix + '__item', [['active', activeIdx == index], ['disabled', item.disabled], [index, true]])}} {{prefix}}-class-item"
  15. aria-disabled="{{item.disabled}}"
  16. aria-role="button"
  17. aria-expanded="{{activeIdx === index}}"
  18. aria-haspopup="menu"
  19. >
  20. <view class="{{classPrefix}}__title {{prefix}}-class-label">{{item.label}}</view>
  21. <template
  22. is="icon"
  23. data="{{..._arrowIcon, ariaHidden: true, tClass: classPrefix + '__icon ' + classPrefix + '__icon--' + (activeIdx == index ? 'active ' : ' ') + prefix + '-class-icon'}}"
  24. />
  25. </view>
  26. <slot />
  27. </view>