preImg.vue
950 Bytes
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
41
42
43
44
45
46
47
48
49
<template>
<div class="dask" @click="showPreImg = false" v-if="showPreImg">
<div class="img-wrap">
<el-image class="img" :src="url" fit="contain"></el-image>
<i class="el-icon-circle-close"></i>
</div>
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: 'pre-img',
data() {
return {
showPreImg: false,
url:'http://qcimg01.glsx.com.cn:7060/group1/M00/02/3E/wKgD3mMtcAqAYYpJAABtFzfpAMg215.png'
}
},
mounted() {},
methods:{
preImage(url){
this.url = url
this.showPreImg = true
}
}
}
</script>
<style lang="scss" scoped>
.dask {
position: fixed;
top: 0;
right: 0;
left: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 200;
display: flex;
justify-content: center;
padding: 50px;
.img-wrap {
position: relative;
width: 100%;
height: 800px;
.img {
width: 100%;
height: 100%;
}
}
}
</style>