hide image on feiled loading in card

This commit is contained in:
Grzegorz Leoniec 2018-10-16 09:38:51 +02:00
parent bf9a87cb24
commit a1bc604dd9

View File

@ -14,7 +14,10 @@
v-if="image || $slots.image">
<!-- @slot Content of the card's image -->
<slot name="image">
<img :src="image" >
<img
:src="image"
v-if="!error"
@error="onError" >
</slot>
</div>
<div
@ -123,6 +126,16 @@ export default {
type: Boolean,
default: false
}
},
data() {
return {
error: false
}
},
methods: {
onError() {
this.error = true
}
}
}
</script>