<template>
  <div class="imgcon">
    <img @click.stop class="v-image" v-for="(item,i) in image" :key="i" preview="0" :src="item.icon" />
  </div>
</template>

<script>
export default {
  props:['image'],
  data(){
    return {
      current:0
    }
  },
  mounted(){
    setTimeout(() => {
      let img = $('.v-image')[0]
      img.click()
    });

    //图片查看器打开后，打印本次查看器的实例（事件、方法、属性的示例）
    this.$preview.on('close',(e,item)=>{
      this.$emit('close')
    })
    
  },
  methods:{
  }
}
</script>

<style lang="less" scoped>
.imgcon{
  .v-image{
    width: 100%;
    height: 540px;
  }
  .toLeft,.toRight{
    font-size: 0;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    z-index: 99;
    cursor: pointer;
    position: absolute;
    color: #fff;
    width: 52px;
    height: 52px;
    background: rgba(0, 0, 0, 0.5);
    padding: 14px;
    >img{
      width: 100%;
      height: 100%;
      cursor: pointer;
    }
  }
  .toRight{
    left: auto;
    right: 10px;
  }
  .scale{
      font-size: 0;
      bottom: 10px;
      right: 10px;
      z-index: 99;
      cursor: pointer;
      position: absolute;
      color: #fff;
      width: 36px;
      height: 36px;
      background: rgba(0, 0, 0, 0.5);
      padding: 10px;
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 18px;
      >img{
        width: 100%;
        height: 100%;
        cursor: pointer;
      }
    }
  .btmdot{
    height: 28px;
    line-height: 28px;
    padding: 0 20px;
    font-size: 14px;
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 14px;
    position: absolute;
    letter-spacing: 1px;
    transform: translateX(-50%);
    left: 50%;
    z-index: 999;
    bottom: 16px;
  }
}
</style>