43 lines
698 B
Java
43 lines
698 B
Java
<template>
|
|
<a-modal
|
|
title="图片预览"
|
|
:width="modalWidth"
|
|
:visible="visible"
|
|
:confirmLoading="confirmLoading"
|
|
:footer="null"
|
|
@cancel="close"
|
|
cancelText="关闭">
|
|
<img class="img-container" :src="imgUrl" alt="">
|
|
</a-modal>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'JImagePreviewModal',
|
|
data () {
|
|
return {
|
|
modalWidth: '60%',
|
|
visible: false,
|
|
confirmLoading: false,
|
|
imgUrl: ''
|
|
}
|
|
},
|
|
methods: {
|
|
open (imgUrl) {
|
|
this.imgUrl = imgUrl
|
|
this.visible = true
|
|
},
|
|
close () {
|
|
this.visible = false
|
|
this.imgUrl = ''
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.img-container {
|
|
width: 100%;
|
|
}
|
|
</style>
|