Add on error for images

pull/1907/head
Stijn Smits 2021-12-18 20:55:34 +01:00 committed by GitHub
parent 97ba4a7ddb
commit 227cdb94a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<span :class="containerClass" :style="style"> <span :class="containerClass" :style="style">
<img v-bind="$attrs" :style="imageStyle" :class="imageClass" /> <img v-bind="$attrs" :style="imageStyle" :class="imageClass" @error="onError"/>
<div class="p-image-preview-indicator" v-if="preview" @click="onImageClick"> <div class="p-image-preview-indicator" v-if="preview" @click="onImageClick">
<slot name="indicator"> <slot name="indicator">
<i class="p-image-preview-icon pi pi-eye"></i> <i class="p-image-preview-icon pi pi-eye"></i>
@ -92,6 +92,9 @@ export default {
this.previewClick = false; this.previewClick = false;
}, },
onError() {
this.$emit('onError');
},
rotateRight() { rotateRight() {
this.rotate += 90; this.rotate += 90;
this.previewClick = true; this.previewClick = true;