mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
960 B
37 lines
960 B
<script setup lang="ts"> |
|
import { ReloadViewDataHookInj, iconMap, inject, ref, useNuxtApp, watch } from '#imports' |
|
|
|
const { $e, $state } = useNuxtApp() |
|
|
|
const reloadHook = inject(ReloadViewDataHookInj)! |
|
|
|
const isReloading = ref(false) |
|
|
|
const onClick = () => { |
|
$e('a:table:reload:navbar') |
|
isReloading.value = true |
|
reloadHook.trigger() |
|
|
|
const stop = watch($state.isLoading, (isLoading) => { |
|
if (!isLoading) { |
|
isReloading.value = false |
|
stop() |
|
} |
|
}) |
|
} |
|
</script> |
|
|
|
<template> |
|
<a-tooltip placement="bottom"> |
|
<template #title> {{ $t('general.reload') }} </template> |
|
|
|
<div class="nc-toolbar-btn flex min-w-32px w-32px h-32px items-center justify-center select-none"> |
|
<component |
|
:is="iconMap.reload" |
|
class="cursor-pointer text-gray-500 group-hover:(text-primary) nc-toolbar-reload-btn" |
|
:class="isReloading ? 'animate-spin' : ''" |
|
@click="onClick" |
|
/> |
|
</div> |
|
</a-tooltip> |
|
</template>
|
|
|