emis-sapp/components/tpx-image/tpx-image.vue
2023-12-12 08:50:19 +08:00

49 lines
635 B
Vue

<template>
<image :src="src" :mode="mode" :hidden="!loadFlag" @load="bindload"></image>
</template>
<script>
export default {
props: {
src: {
default () {
return ''
}
},
mode: {
default () {
return 'widthFix'
}
},
scale: {
default () {
return [1, 1] // 宽高比
}
},
},
data() {
return {
loadFlag: false,
imageHeight: 0,
}
},
created() {
},
onHide() {
},
destroyed() {},
methods: {
bindload: function(res) {
this.loadFlag = true
this.imageHeight = res.detail.height
}
}
}
</script>
<style scoped lang="scss">
</style>