perf: add fallback without waiting for error

This commit is contained in:
Methapon2001 2024-12-17 14:38:52 +07:00
parent 69dd4d67d7
commit ca38cfaec0

View file

@ -24,7 +24,7 @@ withDefaults(
age: string; age: string;
nationality: string; nationality: string;
documentExpireDate: string; documentExpireDate: string;
imgUrl: string; imgUrl?: string;
status: string; status: string;
}[]; }[];
}>(), }>(),
@ -116,11 +116,16 @@ const columns = [
> >
<template v-slot:img-column="{ props }"> <template v-slot:img-column="{ props }">
<q-avatar class="q-mr-sm" size="md"> <q-avatar class="q-mr-sm" size="md">
<q-img :src="props.row.imgUrl" class="full-height full-width"> <q-img
v-if="props.row.imgUrl"
:src="props.row.imgUrl"
class="full-height full-width"
>
<template #error> <template #error>
<q-img :src="fallbackImg" :ratio="1" /> <q-img :src="fallbackImg" :ratio="1" />
</template> </template>
</q-img> </q-img>
<q-img v-else :src="fallbackImg" :ratio="1" />
<div <div
class="absolute-bottom-right" class="absolute-bottom-right"
style=" style="