loading.wxml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <wxs src="../common/utils.wxs" module="_" />
  2. <view
  3. style="{{_._style([style, customStyle, !text ? ('width: ' + _.addUnit(size) + '; height: ' + _.addUnit(size)) : '', show ? '' : 'display: none', inheritColor ? 'color: inherit' : ''])}}"
  4. class="class {{prefix}}-class {{classPrefix}} {{classPrefix + '--' + layout}}"
  5. >
  6. <view
  7. wx:if="{{indicator}}"
  8. class="{{prefix}}-class-indicator {{classPrefix}}__spinner {{classPrefix}}__spinner--{{ theme }} {{reverse ? 'reverse' : ''}}"
  9. style="width: {{ _.addUnit(size) }}; height: {{ _.addUnit(size) }}; {{inheritColor ? 'color: inherit;' : ''}} {{indicator ? '' : 'display: none;'}} {{duration ? 'animation-duration: ' + duration / 1000 + 's;' : ''}} animation-play-state: {{pause ? 'paused' : 'running'}};"
  10. aria-role="{{ariaRole || 'img'}}"
  11. aria-label="{{ ariaLabel || text || '加载中' }}"
  12. >
  13. <view wx:if="{{ theme === 'spinner' }}" wx:for="{{12}}" wx:key="index" class="{{classPrefix}}__dot" />
  14. <view wx:if="{{ theme === 'circular' }}" class="{{classPrefix}}__circular" />
  15. <block wx:if="{{ theme === 'dots' }}">
  16. <view
  17. class="{{classPrefix}}__dot"
  18. style="{{duration ? 'animation-duration: ' + duration/1000 + 's; animation-delay:' + 0 + 's;' : ''}} animation-play-state: {{pause ? 'paused' : 'running'}};"
  19. ></view>
  20. <view
  21. class="{{classPrefix}}__dot"
  22. style="{{duration ? 'animation-duration: ' + duration/1000 + 's; animation-delay:' + duration * 1 / 3000 + 's;' : ''}} animation-play-state: {{pause ? 'paused' : 'running'}};"
  23. ></view>
  24. <view
  25. class="{{classPrefix}}__dot"
  26. style="{{duration ? 'animation-duration: ' + duration/1000 + 's; animation-delay:' + duration * 2 / 3000 + 's;' : ''}} animation-play-state: {{pause ? 'paused' : 'running'}};"
  27. ></view>
  28. </block>
  29. </view>
  30. <view
  31. class="{{_.cls(classPrefix + '__text', [layout])}} {{prefix}}-class-text"
  32. aria-hidden="{{indicator}}"
  33. aria-label="{{ ariaLabel || text }}"
  34. >
  35. <block wx:if="{{text}}">{{text}}</block>
  36. <slot name="text" />
  37. <slot />
  38. </view>
  39. </view>