qx
10 分钟以前 4c4abb59d6ee838c61b851fcc7be93c0522c39c4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<template>
  <div class="">
    <div v-if="srcList && srcList.length > 1" class="tips">点击图片查看更多</div>
    <el-image style="width: 100px; height: 100px" :src="url" :preview-src-list="srcList">
      <div slot="error" class="image-slot">
        <i class="el-icon-picture-outline" />
      </div>
    </el-image>
  </div>
</template>
 
<script>
export default {
  name: 'ImgList',
  props: {
    imageList: {
      type: Array,
      default: () => []
    }
  },
  computed: {
    url() {
      if (this.imageList && this.imageList.length) {
        return this.imageList[0].url
      }
      return null
    },
    srcList() {
      return this.imageList.map((item) => item.url)
    }
  }
}
</script>
 
<style scoped lang="scss">
.tips {
  color: #999;
  font-size: 12px;
  margin-top: 5px;
}
</style>