<template>
  <div class="preview-image">
    <el-tooltip :effect="effect" :content="content" :placement="placement">
      <el-image
        v-if="!$attrs['preview-src-list']"
        v-bind="$attrs"
        :preview-src-list="[$attrs.src]"
        :style="{ width: width, height, height }"
      />
      <el-image v-else v-bind="$attrs" :style="{ width: width, height, height }" />
    </el-tooltip>
  </div>
</template>
<script>
export default {
  name: 'PreviewImage',
  props: {
    effect: {
      type: String,
      default: 'dark'
    },
    content: {
      type: String,
      default: '点击查看原图'
    },
    placement: {
      type: String,
      default: 'top-start'
    },
    width: {
      type: String,
      default: '120px'
    },
    height: {
      type: String,
      default: '120px'
    }
  }
}
</script>
