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;
nationality: string;
documentExpireDate: string;
imgUrl: string;
imgUrl?: string;
status: string;
}[];
}>(),
@ -116,11 +116,16 @@ const columns = [
>
<template v-slot:img-column="{ props }">
<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>
<q-img :src="fallbackImg" :ratio="1" />
</template>
</q-img>
<q-img v-else :src="fallbackImg" :ratio="1" />
<div
class="absolute-bottom-right"
style="