Skip to content

Commit

Permalink
feat(vue): emit error event
Browse files Browse the repository at this point in the history
  • Loading branch information
johannschopplich committed Feb 19, 2024
1 parent a79fc71 commit d425287
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/vue/src/components/UnLazyImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const props = defineProps<{
const emit = defineEmits<{
(event: 'loaded', image: HTMLImageElement): void
(event: 'error', error: Event): void
}>()
const target = ref<HTMLImageElement | undefined>()
Expand Down Expand Up @@ -69,5 +70,6 @@ onBeforeUnmount(() => {
:data-srcset="srcSet"
:data-sizes="autoSizes ? 'auto' : undefined"
loading="lazy"
@error="emit('error', $event)"
>
</template>

0 comments on commit d425287

Please sign in to comment.