component.vue 1.4 KB
Newer Older
fxy060608's avatar
fxy060608 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
<template>
  <uni-page-refresh>
    <div :style="{ 'margin-top': offset + 'px' }" class="uni-page-refresh">
      <div class="uni-page-refresh-inner">
        <svg
          :fill="color"
          class="uni-page-refresh__icon"
          width="24"
          height="24"
          viewBox="0 0 24 24"
        >
          <path
            d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"
          />
          <path d="M0 0h24v24H0z" fill="none" />
        </svg>
        <svg
          class="uni-page-refresh__spinner"
          width="24"
          height="24"
          viewBox="25 25 50 50"
        >
          <circle
            :stroke="color"
            class="uni-page-refresh__path"
            cx="50"
            cy="50"
            r="20"
            fill="none"
            stroke-width="4"
            stroke-miterlimit="10"
          />
        </svg>
      </div>
    </div>
  </uni-page-refresh>
</template>
<script lang="ts">
fxy060608's avatar
fxy060608 已提交
39
import { usePageMeta } from '../../../setup/provide'
fxy060608's avatar
fxy060608 已提交
40 41 42
export default {
  name: 'PageRefresh',
  setup() {
fxy060608's avatar
fxy060608 已提交
43
    const { pullToRefresh } = usePageMeta()
fxy060608's avatar
fxy060608 已提交
44
    return {
fxy060608's avatar
fxy060608 已提交
45 46
      offset: pullToRefresh!.offset,
      color: pullToRefresh!.color,
fxy060608's avatar
fxy060608 已提交
47 48 49 50
    }
  },
}
</script>