多维表格
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.
 
 
 
 
 
 

42 lines
1.0 KiB

<script setup lang="ts">
const { $e, $state } = useNuxtApp()
const { isPaginationLoading } = storeToRefs(useViewsStore())
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()
}
})
}
watch(isReloading, () => {
isPaginationLoading.value = isReloading.value
})
</script>
<template>
<NcTooltip placement="bottom">
<template #title> {{ $t('general.reload') }} </template>
<div
class="flex ml-1 items-center justify-center select-none cursor-pointer text-gray-500 w-5.5 h-5.5 hover:(bg-gray-100 text-black) rounded"
>
<component
:is="iconMap.reload"
class="group-hover:(text-primary) h-4 nc-icon-reload text-gray-400"
:class="isReloading ? 'animate-spin' : ''"
@click="onClick"
/>
</div>
</NcTooltip>
</template>