45 lines
548 B
Vue
45 lines
548 B
Vue
<template>
|
|
<image :src="url" :mode="mode" @error="imgError" class="h-100 w-100"></image>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
props: {
|
|
src: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
alt: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
mode: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
width: {
|
|
type: Number,
|
|
default: 70
|
|
},
|
|
height: {
|
|
type: Number,
|
|
default: 90
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
url: this.src
|
|
};
|
|
},
|
|
methods: {
|
|
imgError(){
|
|
this.url = this.alt;
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
|
|
</style>
|