feat: add clear button

This commit is contained in:
Methapon Metanipat 2024-08-28 13:17:29 +07:00
parent 5a27d424cc
commit 7400f9f611
3 changed files with 31 additions and 9 deletions

View file

@ -1,6 +1,6 @@
<script lang="ts" setup>
import AppBox from './app/AppBox.vue';
import { CancelButton, SaveButton } from './button';
import { CancelButton, ClearButton, SaveButton } from './button';
defineExpose({ browse });
defineProps<{
@ -131,20 +131,15 @@ async function downloadImage(url: string) {
class="row items-center justify-end q-py-sm q-px-md bordered-t"
v-if="!hiddenFooter"
>
<q-btn
dense
unelevated
flat
:color="$q.dark.isActive ? 'grey-9' : 'grey-4'"
:text-color="$q.dark.isActive ? 'grey-1' : 'grey-10'"
:label="$t('general.clear')"
<ClearButton
outlined
@click="
inputFile && (inputFile.value = ''),
(imageUrl = defaultUrl || fallbackUrl || ''),
(file = null)
"
class="q-px-md q-mr-auto"
:disable="
:disabled="
clearButtonDisabled ||
imageUrl === fallbackUrl ||
imageUrl === defaultUrl ||