Files
CompanyProject/金壶/appV1/components/an-image/an-image.vue
2024-09-27 01:32:49 +08:00

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>