preImg.vue 950 Bytes
<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>