<template>
  <el-dialog :visible.sync="isShowDialog" title="图片预览" @close="close">
    <el-carousel indicator-position="outside" height="380px">
      <el-carousel-item v-for="(src, index) in imgList" :key="index">
        <img :src="homeUrl + src" width="100%" height="100%">
      </el-carousel-item>
    </el-carousel>
  </el-dialog>
</template>

<script>
export default {
  name: 'ImgPreview',
  props: {
    isShow: {
      type: Boolean,
      default: () => {
        return false
      }
    },
    homeUrl: {
      type: String,
      default: () => {
        return ''
      }
    },
    imgList: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  data() {
    return {
    }
  },
  computed: {
    isShowDialog: {
      get() {
        return this.isShow
      },
      set(newValue) {
        this.$emit('closeImgPreviewDialog', newValue)
      }
    }
  },
  methods: {
    close() {
    }
  }
}
</script>

<style scoped>
</style>

<style>
  .el-carousel--horizontal {
    overflow: hidden!important;
  }
</style>
