graceLoading.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template name="graceLoading">
  2. <view class="grace-loading grace-ellipsis" v-if="loadingType < 4">
  3. <view class="grace-loading-icon" v-if="loadingType === 1" :style="{color:iconColor}"></view>
  4. <text :style="{color:textColor}">{{loadingText[loadingType]}}</text>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. props: {
  10. loadingType: {
  11. type : Number,
  12. default: 0
  13. },
  14. loadingText : {
  15. type : Array,
  16. default : function () {
  17. // 0 上拉加载更多
  18. // 1 加载中
  19. // 2 加载全部
  20. // 3 空文本
  21. // 4 不展示组件
  22. return ["上拉加载更多", "正在努力加载", "已经加载全部数据",'',''];
  23. }
  24. },
  25. iconColor : {
  26. type : String,
  27. default : "#888888"
  28. },
  29. textColor : {
  30. type : String,
  31. default : "#888888"
  32. }
  33. }
  34. }
  35. </script>
  36. <style scoped>
  37. @keyframes grace-rotate360{0%{transform:rotate(0deg);} 50%{transform:rotate(180deg);} 100%{transform:rotate(360deg);}}
  38. .grace-loading{display:flex; width:100%; justify-content:center; padding:16rpx 0; padding-bottom:36rpx; line-height:40rpx; color:#888;}
  39. .grace-loading text{margin-left:12rpx;}
  40. .grace-loading-icon{width:40rpx; height:40rpx; justify-content:center; line-height:40rpx; font-size:30rpx; text-align:center; font-family:"grace-iconfont"; animation:grace-rotate360 1200ms infinite linear;}
  41. .grace-loading-icon:before {content:"\e9db";}
  42. </style>