tui-skeleton.wxml 961 B

12345678910111213141516171819202122232425
  1. <view class="tui-skeleton-cmomon tui-skeleton-box" style="width: {{winWidth}}px; height: {{winHeight}}px; background-color:{{backgroundColor}};">
  2. <view class="tui-skeleton-cmomon" wx:for="{{skeletonElements}}" wx:key="{{index}}" style="width: {{item.width}}px; height: {{item.height}}px; left: {{item.left}}px; top: {{item.top}}px;background-color: {{skeletonBgColor}};border-radius:{{parse.getRadius(item.skeletonType,borderRadius)}}"></view>
  3. <view class="tui-loading {{parse.getLoadingType(loadingType)}}"></view>
  4. </view>
  5. <wxs module="parse">
  6. module.exports = {
  7. getLoadingType: function(type) {
  8. var value = 1
  9. if (type && type > 0 && type < 11) {
  10. value = type
  11. }
  12. return 'tui-loading-' + value
  13. },
  14. getRadius: function(type, val) {
  15. var radius = "0"
  16. if (type == "circular") {
  17. radius = "50%"
  18. } else if (type == "fillet") {
  19. radius = val
  20. }
  21. return radius;
  22. }
  23. }
  24. </wxs>