Files
income_payments_client/src/components/PreviewImgModal.vue
T
2021-12-16 16:57:12 +08:00

49 lines
843 B
Vue

<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
switchFullscreen
@cancel="handleCancel"
cancelText="关闭">
<img :src="imgSrc" class="preview-img">
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
</template>
</j-modal>
</template>
<script>
export default {
name: 'PreviewImgModal',
data() {
return {
title: '图片',
width: 800,
visible: false,
confirmLoading: false,
// 图片id
imgId: ''
}
},
computed: {
imgSrc() {
return `${ window._CONFIG['domianURL'] }/sys/common/download/${ this.imgId }`
}
},
methods: {
handleCancel() {
this.visible = false
}
}
}
</script>
<style scoped>
.preview-img {
width: 100%;
}
</style>