研发图纸文件管理系统-前端项目
longyvfengyun
2022-07-21 7a7dae8959c9bfe0d63ed9dc1538e059d619969d
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="image-view">
    <img :src="url" @click="previewVisible=true">
    <a-modal :width="width" :visible="previewVisible" :footer="null" @cancel="handleCancel">
      <img alt="example" style="width: 100%" :src="url" />
    </a-modal>
  </div>
</template>
 
<script>
export default {
  name: "ImageView",
  props: {
    url: {
      type: String,
      default: ""
    },
    width: {
      type: Number,
      default: 600
    }
  },
  data() {
    return {
      previewVisible: false,
    }
  },
  methods: {
    handleCancel() {
      this.previewVisible = false;
    },
  }
}
</script>
 
<style scoped>
.image-view img {
  width: 100%;
  height: auto;
}
</style>