index.wxml 1.3 KB

123456789101112131415161718192021222324252627282930
  1. <wxs
  2. src="./index.wxs"
  3. module="divider" />
  4. <view
  5. wx:if="{{ direction === 'horizontal' }}"
  6. class="ant-divider ant-divider-horizontal {{ className || '' }}"
  7. style="{{ style || '' }}">
  8. <view
  9. class="ant-divider-horizontal-left"
  10. style="flex: {{ divider.getLineWidthFlex(textPosition, text)[0] }};{{ lineHeight ? 'border-bottom-width:' + lineHeight + 'px;' : '' }}{{ lineType ? 'border-bottom-style:' + lineType + ';' : '' }}{{ lineColor ? 'border-bottom-color:' + lineColor + ';' : '' }}" />
  11. <view
  12. wx:if="{{ text }}"
  13. class="ant-divider-horizontal-text {{ textClassName || '' }}"
  14. style="{{ textStyle || '' }}">
  15. {{ text }}
  16. </view>
  17. <slot
  18. wx:else
  19. name="text" />
  20. <view
  21. class="ant-divider-horizontal-right"
  22. style="flex: {{ divider.getLineWidthFlex(textPosition, text)[1] }};{{ lineHeight ? 'border-bottom-width:' + lineHeight + 'px;' : '' }}{{ lineType ? 'border-bottom-style:' + lineType + ';' : '' }}{{ lineColor ? 'border-bottom-color:' + lineColor + ';' : '' }}" />
  23. </view>
  24. <view
  25. wx:if="{{ direction === 'vertical' }}"
  26. class="ant-divider ant-divider-vertical {{ className || '' }}"
  27. style="{{ style || '' }};{{ lineWidth ? 'border-right-width:' + lineWidth + 'px;' : '' }}{{ lineType ? 'border-right-style:' + lineType + ';' : '' }}{{ lineColor ? 'border-right-color:' + lineColor + ';' : '' }}" />