From d425287474190a53ca95d016a3c71b763ae5f447 Mon Sep 17 00:00:00 2001 From: Johann Schopplich Date: Mon, 19 Feb 2024 08:38:17 +0100 Subject: [PATCH] feat(vue): emit `error` event --- packages/vue/src/components/UnLazyImage.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/vue/src/components/UnLazyImage.vue b/packages/vue/src/components/UnLazyImage.vue index 0307b24..2b4494c 100644 --- a/packages/vue/src/components/UnLazyImage.vue +++ b/packages/vue/src/components/UnLazyImage.vue @@ -30,6 +30,7 @@ const props = defineProps<{ const emit = defineEmits<{ (event: 'loaded', image: HTMLImageElement): void + (event: 'error', error: Event): void }>() const target = ref() @@ -69,5 +70,6 @@ onBeforeUnmount(() => { :data-srcset="srcSet" :data-sizes="autoSizes ? 'auto' : undefined" loading="lazy" + @error="emit('error', $event)" >