mescroll-down.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <!-- 下拉刷新区域 -->
  2. <template>
  3. <view v-if="mOption.use" class="mescroll-downwarp" :style="{'background':mOption.bgColor,'color':mOption.textColor}">
  4. <view class="downwarp-content">
  5. <image class="downwarp-slogan" src="https://www.mescroll.com/img/beibei/mescroll-slogan.jpg?v=1" mode="widthFix"/>
  6. <view v-if="isDownLoading" class="downwarp-loading mescroll-rotate"></view>
  7. <view v-else class="downwarp-progress" :style="{'transform':downRotate}"></view>
  8. <view class="downwarp-mascot"></view>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. props: {
  15. option: Object , // down的配置项
  16. type: Number // 下拉状态(inOffset:1, outOffset:2, showLoading:3, endDownScroll:4)
  17. },
  18. computed: {
  19. // 支付宝小程序需写成计算属性,prop定义default仍报错
  20. mOption(){
  21. return this.option || {}
  22. },
  23. // 是否在加载中
  24. isDownLoading(){
  25. return this.type === 3
  26. },
  27. // 旋转的角度
  28. downRotate(){
  29. return this.type === 2 ? 'rotate(180deg)' : 'rotate(0deg)'
  30. }
  31. }
  32. };
  33. </script>
  34. <style>
  35. @import "../../../mescroll-uni/components/mescroll-down.css";
  36. @import "./mescroll-down.css";
  37. </style>