vue-image-fallback
Vue directive for broken images
Usage
;; Vue;
Example with string
Example with array
Example with object
<template> <img src="foo.png" v-image-fallback="imageFallbackOptions"></template> <script> export default { data() { return { imageFallbackOptions: { images: [ "image_1", "image_2", "etc", ], loading: "url/to/loader/image", onError: this.onError() } } }, methods: { onError() { // do something here when all images failed to load } } }</script>