mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-02 06:19:58 +00:00
Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: filtered <176114999+webfiltered@users.noreply.github.com> Co-authored-by: Christian Byrne <cbyrne@comfy.org> Co-authored-by: Terry Jia <terryjia88@gmail.com> Co-authored-by: comfy-waifu <comfywaifu.ai@gmail.com> Co-authored-by: Comfy Org PR Bot <snomiao+comfy-pr@gmail.com>
54 lines
990 B
Vue
54 lines
990 B
Vue
<template>
|
|
<Button
|
|
outlined
|
|
class="!m-0 p-0 rounded-lg"
|
|
:class="[
|
|
variant === 'black'
|
|
? 'bg-neutral-900 text-white border-neutral-900'
|
|
: 'border-neutral-700',
|
|
fullWidth ? 'w-full' : 'w-min-content'
|
|
]"
|
|
:disabled="loading"
|
|
v-bind="$attrs"
|
|
@click="onClick"
|
|
>
|
|
<span class="py-2.5 px-3 whitespace-nowrap">
|
|
<template v-if="loading">
|
|
{{ loadingMessage ?? $t('g.loading') }}
|
|
</template>
|
|
<template v-else>
|
|
{{ label }}
|
|
</template>
|
|
</span>
|
|
</Button>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import Button from 'primevue/button'
|
|
|
|
const {
|
|
label,
|
|
loadingMessage,
|
|
fullWidth = false,
|
|
variant = 'default'
|
|
} = defineProps<{
|
|
label: string
|
|
loading?: boolean
|
|
loadingMessage?: string
|
|
fullWidth?: boolean
|
|
variant?: 'default' | 'black'
|
|
}>()
|
|
|
|
const emit = defineEmits<{
|
|
action: []
|
|
}>()
|
|
|
|
defineOptions({
|
|
inheritAttrs: false
|
|
})
|
|
|
|
const onClick = (): void => {
|
|
emit('action')
|
|
}
|
|
</script>
|