1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
| <template>
| <div class="preview-image" @click="handleBack" v-if="imgUrl">
| <img class="image-view-img" v-lazy="imgUrl" />
| </div>
| </template>
|
| <script>
| export default {
| name: "preview-image",
| props: ["imgUrl"],
| data() {
| return {};
| },
| methods: {
| handleBack() {
| this.$emit("handleBack");
| },
| },
| };
| </script>
| <style lang="less">
| .preview-image {
| position: fixed;
| left: 0;
| top: 0;
| width: 100%;
| height: 100%;
| z-index: 999;
| background: rgba(51, 51, 51, 1);
| .image-view-img {
| position: absolute;
| left: 50%;
| top: 50%;
| -webkit-transform: translate(-50%, -50%);
| transform: translate(-50%, -50%);
| max-height: 100%;
| max-width: 100%;
| }
| }
| </style>
|
|