uni-im-load-state.vue 1.3 KB
Newer Older
DCloud_JSON's avatar
DCloud_JSON 已提交
1
<template>
DCloud_JSON's avatar
DCloud_JSON 已提交
2 3
  <view class="refresh-box">
    <uni-icons v-if="status == 'loading'" color="#bbb" :size="24" class="refresh-icon" type="spinner-cycle"></uni-icons>
DCloud_JSON's avatar
DCloud_JSON 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
    <text class="refresh-text">{{status == 'loading'?contentText.contentrefresh:contentText.contentnomore}}</text>
  </view>
</template>

<script>
  export default {
    props: {
      status: {
        type: String,
        default: "loading"
      },
      contentText: {
        type: Object,
        default () {
          return {
            "contentrefresh": "加载中...",
            "contentnomore": "- 没有相关数据 -"
          }
        }
      }
    }
  }
</script>

28
<style lang="scss" scoped>
DCloud_JSON's avatar
DCloud_JSON 已提交
29 30 31 32 33
  .refresh-box {
    height: 50px;
    justify-content: center;
    align-items: center;
    flex-direction: row;
DCloud_JSON's avatar
DCloud_JSON 已提交
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
    width: 750rpx;
  }
  /* #ifdef H5 */
  @media screen and (min-device-width:960px){
    .refresh-box {
      width: 100%;
    }
  }
  /* #endif */
  
  // 给refresh-icon增加旋转的动画
  @keyframes rotate {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }
  .refresh-icon {
    animation: rotate 1.3s linear infinite;
DCloud_JSON's avatar
DCloud_JSON 已提交
55 56 57 58 59
    margin: 5px;
  }

  .refresh-text {
    color: #bbb;
DCloud_JSON's avatar
DCloud_JSON 已提交
60
    font-size: 14px;
DCloud_JSON's avatar
DCloud_JSON 已提交
61 62
  }
</style>