mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-12-25 05:50:18 +08:00
28 lines
723 B
Vue
28 lines
723 B
Vue
<template>
|
|
<hover-container class="w-64px h-full" tooltip-content="重新加载" placement="bottom-end" @click="handleRefresh">
|
|
<icon-mdi-refresh class="text-22px" :class="{ 'animate-spin': loading }" />
|
|
</hover-container>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { useRoute } from 'vue-router';
|
|
import { useRouteStore } from '@/store';
|
|
import { useLoading } from '@/hooks';
|
|
|
|
defineOptions({ name: 'ReloadButton' });
|
|
|
|
const { reCacheRoute } = useRouteStore();
|
|
const route = useRoute();
|
|
const { loading, startLoading, endLoading } = useLoading();
|
|
|
|
async function handleRefresh() {
|
|
startLoading();
|
|
|
|
await reCacheRoute(route.name as AuthRoute.AllRouteKey);
|
|
|
|
endLoading();
|
|
}
|
|
</script>
|
|
|
|
<style scoped></style>
|