collapse-panel.wxml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <wxs src="../common/utils.wxs" module="_" />
  2. <view
  3. style="{{_._style([style, customStyle])}}"
  4. class="{{classPrefix}} {{classPrefix}}--{{placement}} {{prefix}}-class"
  5. >
  6. <view
  7. class="{{classPrefix}}__title"
  8. aria-role="button"
  9. aria-expanded="{{expanded}}"
  10. aria-disabled="{{ultimateDisabled}}"
  11. bind:tap="onClick"
  12. >
  13. <t-cell
  14. title="{{header}}"
  15. note="{{headerRightContent}}"
  16. bordered
  17. right-icon="{{ ultimateExpandIcon ? (expanded ? 'chevron-up' : 'chevron-down') : '' }}"
  18. t-class="{{_.cls(classPrefix + '__header', [placement, ['expanded', expanded]])}} {{prefix}}-class-header"
  19. t-class-title="class-title {{ultimateDisabled ? 'class-title--disabled' : ''}}"
  20. t-class-note="class-note {{ultimateDisabled ? 'class-note--disabled' : ''}}"
  21. t-class-right-icon="class-right-icon {{classPrefix}}__arrow--{{placement}} {{ultimateDisabled ? 'class-right-icon--disabled' : ''}}"
  22. t-class-hover="class-header-hover"
  23. >
  24. <slot name="header" slot="title" />
  25. <slot name="header-right-content" slot="note" />
  26. <slot name="expand-icon" slot="right-icon" />
  27. </t-cell>
  28. </view>
  29. <view class="{{classPrefix}}__wrapper" animation="{{animation}}" aria-hidden="{{expanded ? '' : true}}">
  30. <view class="{{classPrefix}}__content {{prefix}}-class-content">
  31. {{content}}
  32. <slot />
  33. <slot name="content" />
  34. </view>
  35. </view>
  36. </view>