mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-04 07:00:23 +00:00
- Update all Vue components to use type imports - Update all TypeScript files to use type imports - Update test files to use type imports - Ensure compliance with TypeScript verbatim module syntax 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
53 lines
1.1 KiB
Vue
53 lines
1.1 KiB
Vue
<!--
|
|
A refresh button that disables and shows a progress spinner whilst active.
|
|
|
|
Usage:
|
|
```vue
|
|
<RefreshButton
|
|
v-model="isRefreshing"
|
|
:outlined="false"
|
|
@refresh="refresh"
|
|
/>
|
|
```
|
|
-->
|
|
<template>
|
|
<Button
|
|
class="relative p-button-icon-only"
|
|
:outlined="outlined"
|
|
:severity="severity"
|
|
:disabled="active || disabled"
|
|
@click="(event) => $emit('refresh', event)"
|
|
>
|
|
<span
|
|
class="p-button-icon pi pi-refresh transition-all"
|
|
:class="{ 'opacity-0': active }"
|
|
data-pc-section="icon"
|
|
/>
|
|
<span class="p-button-label" data-pc-section="label"> </span>
|
|
<ProgressSpinner v-show="active" class="absolute w-1/2 h-1/2" />
|
|
</Button>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import Button from 'primevue/button'
|
|
import ProgressSpinner from 'primevue/progressspinner'
|
|
|
|
import { type PrimeVueSeverity } from '@/types/primeVueTypes'
|
|
|
|
const {
|
|
disabled,
|
|
outlined = true,
|
|
severity = 'secondary'
|
|
} = defineProps<{
|
|
disabled?: boolean
|
|
outlined?: boolean
|
|
severity?: PrimeVueSeverity
|
|
}>()
|
|
|
|
// Model
|
|
const active = defineModel<boolean>({ required: true })
|
|
|
|
// Emits
|
|
defineEmits(['refresh'])
|
|
</script>
|