riku
2024-10-30 d4e7c11e06b643c9353444c839cec40c25945219
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<template>
  <table>
    <tbody>
      <tr v-if="!downTitle">
        <td>
          <el-row justify="space-between" align="middle">
            {{ title }}
            <el-button size="small" @click="$emit('change')">{{
              btnName
            }}</el-button>
          </el-row>
        </td>
      </tr>
      <tr>
        <td>
          <el-image
            class="image"
            :src="imgSrc"
            :preview-src-list="[imgSrc]"
            :initial-index="0"
            fit="cover"
            lazy
          />
        </td>
      </tr>
      <tr v-if="downTitle">
        <td>
          <el-row justify="space-between" align="middle">
            {{ title }}
            <el-button size="small" @click="$emit('change')">{{
              btnName
            }}</el-button>
          </el-row>
        </td>
      </tr>
    </tbody>
  </table>
</template>
<script setup>
import { ref } from 'vue';
 
const props = defineProps({
  // 标题是否在图片下方
  downTitle: Boolean,
  title: String,
  imgSrc: String,
  btnName: {
    type: String,
    default: '修改'
  }
});
 
const emit = defineEmits(['change']);
</script>
<style scoped>
.image {
  width: 200px;
  height: 210px;
  border-radius: 4px;
}
 
table {
  color: #333333;
  border-color: #666666;
  border-collapse: collapse;
}
 
tr {
  font-size: var(--el-font-size-small);
}
 
td {
  border: 1px solid black;
  padding: 2px 6px;
  /* border-width: 1px;
  padding: 8px;
  border-style: solid;
  border-color: #666666; */
}
</style>