index.axml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <import-sjs
  2. from="./index.sjs"
  3. name="utils" />
  4. <view
  5. class="ant-collapse {{ className ? className : '' }}"
  6. style="{{ style }}">
  7. <block
  8. a:for="{{ items }}"
  9. a:for-index="index"
  10. a:for-item="item">
  11. <view
  12. class="ant-collapse-item {{ utils.isActive(mixin.value, index, item.disabled) ? 'ant-collapse-item-active' : '' }} {{ item.disabled ? 'ant-collapse-item-disabled' : '' }}">
  13. <view
  14. class="ant-collapse-item-title"
  15. data-active="{{ utils.isActive(mixin.value, index, item.disabled) }}"
  16. data-index="{{ index }}"
  17. data-id="{{ $id }}"
  18. onTap="onChange">
  19. <view class="ant-collapse-item-line">
  20. <view class="ant-collapse-item-title-node">
  21. <slot
  22. name="title"
  23. value="{{ item }}"
  24. index="{{ index }}"
  25. current="{{ mixin.value }}">
  26. {{ item.title }}
  27. </slot>
  28. </view>
  29. <view class="ant-collapse-item-brief-container">
  30. <view class="ant-collapse-item-brief-node">
  31. <slot
  32. name="brief"
  33. value="{{ item }}"
  34. index="{{ index }}"
  35. current="{{ mixin.value }}">
  36. {{ brief }}
  37. </slot>
  38. </view>
  39. <view class="ant-collapse-item-title-arrow">
  40. <slot
  41. name="icon"
  42. value="{{ item }}"
  43. index="{{ index }}"
  44. current="{{ mixin.value }}">
  45. <ant-icon
  46. type="{{ utils.isActive(mixin.value, index, item.disabled) ? 'UpOutline' : 'DownOutline' }}" />
  47. </slot>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. <view
  53. class="ant-collapse-item-content-wrap {{ hasChange ? 'ant-collapse-item-content-wrap-transition' : '' }} ant-collapse-item-content-wrap{{ $id ? '-' + $id : '' }}-{{ index }}"
  54. onTransitionEnd="resetContentHeight"
  55. style="{{ utils.getStyleHeight(index, contentHeight, item.disabled) }}"
  56. data-index="{{ index }}">
  57. <view class="ant-collapse-item-content-container">
  58. <view
  59. class="ant-collapse-item-content ant-collapse-item-content{{ $id ? '-' + $id : '' }}-{{ index }}">
  60. <slot
  61. name="content"
  62. value="{{ item }}"
  63. index="{{ index }}"
  64. current="{{ mixin.value }}">
  65. {{ item.content }}
  66. </slot>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </block>
  72. </view>