8
0
ZaiZai 1 år sedan
förälder
incheckning
a49289a18c
1 ändrade filer med 14 tillägg och 5 borttagningar
  1. 14 5
      src/layout/modules/Refresh.vue

+ 14 - 5
src/layout/modules/Refresh.vue

@@ -1,13 +1,13 @@
 <template>
     <div class="header-icon-bar" @click="tapClick">
         <el-tooltip content="强刷新" placement="top">
-            <hc-icon name="refresh" class="header-icon" />
+            <hc-icon name="refresh" class="header-icon" :class="isLoading ? 'rotation' : ''" />
         </el-tooltip>
     </div>
 </template>
 
 <script setup>
-import { ref } from 'vue'
+import { nextTick, ref } from 'vue'
 import { setRouterData } from '~sto/user'
 import { initButtons } from '~sto/app'
 import { delStoreValue } from '~src/utils/storage'
@@ -24,13 +24,22 @@ const tapClick = async () => {
     }
     //获取按钮权限数据
     delStoreValue('buttons')
+    await nextTick()
     await initButtons()
-    isLoading.value = false
     //刷新路由
-    //window.location.reload()
+    await nextTick()
+    isLoading.value = false
+    window.location.reload()
 }
 </script>
 
 <style lang="scss" scoped>
-
+.rotation {
+    animation: hc-ani-rotation-loop 1s linear infinite;
+}
+@keyframes hc-ani-rotation-loop {
+    from { transform: rotate(0deg);}
+    50%  { transform: rotate(180deg);}
+    to   { transform: rotate(360deg);}
+}
 </style>