first commit
This commit is contained in:
44
金壶/appV1/components/an-image/an-image.vue
Normal file
44
金壶/appV1/components/an-image/an-image.vue
Normal file
@@ -0,0 +1,44 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user