mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +00:00
86 lines
2.1 KiB
Vue
86 lines
2.1 KiB
Vue
<template>
|
|
<Modal
|
|
:value="previewImageList.length > 0"
|
|
:mask-closable="false"
|
|
:footer-hide="true"
|
|
:transition-names="['fade', 'fade']"
|
|
fullscreen
|
|
@on-visible-change="visibleChange"
|
|
class-name="common-preview-image">
|
|
<PreviewImageView v-if="previewImageList.length > 0" :initial-index="previewImageIndex" :url-list="previewImageList" infinite/>
|
|
</Modal>
|
|
</template>
|
|
|
|
<style lang="scss">
|
|
body {
|
|
.ivu-modal-wrap {
|
|
&.common-preview-image {
|
|
.ivu-modal {
|
|
margin: 0;
|
|
padding: 0;
|
|
.ivu-modal-content {
|
|
background: transparent;
|
|
.ivu-modal-close {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
border-radius: 50%;
|
|
background-color: #606266;
|
|
font-size: 24px;
|
|
height: 40px;
|
|
right: 40px;
|
|
top: 40px;
|
|
width: 40px;
|
|
.ivu-icon-ios-close {
|
|
top: 0;
|
|
right: 0;
|
|
font-size: 40px;
|
|
color: #fff;
|
|
}
|
|
}
|
|
.ivu-modal-body {
|
|
padding: 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
import PreviewImageView from "./view";
|
|
import {mapState} from "vuex";
|
|
|
|
export default {
|
|
name: 'PreviewImage',
|
|
components: {PreviewImageView},
|
|
|
|
data() {
|
|
return {
|
|
|
|
}
|
|
},
|
|
mounted() {
|
|
|
|
},
|
|
computed: {
|
|
...mapState([
|
|
'previewImageIndex',
|
|
'previewImageList',
|
|
]),
|
|
},
|
|
methods: {
|
|
visibleChange(val) {
|
|
if (!val) {
|
|
this.close()
|
|
}
|
|
},
|
|
close() {
|
|
this.$store.state.previewImageIndex = 0;
|
|
this.$store.state.previewImageList = [];
|
|
},
|
|
}
|
|
};
|
|
</script>
|