<template>
  <el-image :previewSrcList="previewList" v-bind="$props"></el-image>
</template>

<script>
export default {
  name: "EdImage",
  props: {
    src: String,
    fit: String,
    alt: String,
    preview: {type: Boolean, default: false},
    referrerPolicy: String,
    lazy: Boolean,
    scrollContainer: {},
    previewSrcList: {type: Array, default: () => []},
    zIndex: {type: Number, default: 2000},
    initialIndex: Number
  },
  computed: {
    previewList() {
      if (this.preview && this.previewSrcList.length === 0) {
        return [this.src]
      }
    }
  }
}
</script>
