disable buttons on submission

This commit is contained in:
Kuchenpirat 2025-06-29 12:35:13 +00:00
commit 8567a06642
2 changed files with 10 additions and 7 deletions

View file

@ -6,12 +6,13 @@
<v-btn
color="error"
:icon="$globals.icons.delete"
:disabled="submitted"
@click="$emit('delete')"
/>
<v-spacer />
<v-menu offset-y :close-on-content-click="false">
<template #activator="{ props }">
<v-btn color="info" v-bind="props" :icon="$globals.icons.edit" />
<v-btn color="info" v-bind="props" :icon="$globals.icons.edit" :disabled="submitted" />
</template>
<v-list>
<template v-for="(row, keyRow) in controls" :key="keyRow">
@ -19,16 +20,12 @@
<v-list-item
v-for="(control, keyControl) in row"
:key="keyControl"
:disabled="submitted"
@click="control.callback()"
>
<v-list-item-icon>
<v-icon :color="control.color">
{{ control.icon }}
</v-icon>
<v-icon :color="control.color" :icon="control.icon" />
</v-list-item-icon>
<v-list-item-content>
<!-- Optionally, you can add a label here if you want -->
</v-list-item-content>
</v-list-item>
</v-list-item-group>
</template>
@ -67,6 +64,10 @@ export default defineNuxtComponent({
type: String,
default: undefined,
},
submitted: {
type: Boolean,
default: false,
},
},
emits: ["save", "delete"],
setup(_, context) {

View file

@ -36,6 +36,7 @@
:img="imageUrl"
cropper-height="100%"
cropper-width="100%"
:submitted="loading"
class="mt-4"
@save="(croppedImage) => updateUploadedImage(index, croppedImage)"
@delete="clearImage(index)"
@ -130,6 +131,7 @@ export default defineNuxtComponent({
}
function updateUploadedImage(index: number, croppedImage: Blob) {
console.log("Cropped image:", croppedImage);
uploadedImages.value[index] = croppedImage;
}