riku
2025-06-09 38ff09bd2a638bc43a365efe0390cc3510d62e68
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
<template>
  <el-table
    ref="tableRef"
    :data="data"
    v-loading="loading"
    table-layout="fixed"
    size="small"
    :show-overflow-tooltip="true"
    border
    row-class-name="t-row"
    cell-class-name="t-cell"
    header-row-class-name="t-header-row"
    header-cell-class-name="t-header-cell"
    :show-summary="false"
    :highlight-current-row="false"
    @row-click="handleRowClick"
  >
    <slot></slot>
  </el-table>
</template>
 
<script>
export default {
  props: {
    loading: Boolean,
    data: Array
  },
  data() {
    return {}
  },
  emits: ['rowClick'],
  watch: {},
  computed: {},
  methods: {
    handleRowClick(row, col, event) {
      this.$emit('rowClick', row.index)
      // console.log(row);
      // console.log(col);
      // console.log(event.target.getBoundingClientRect().height);
    }
  }
}
</script>
<style>
.el-table {
  --el-table-bg-color: transparent;
  --el-table-row-hover-bg-color: #23dad0a2;
  --el-table-current-row-bg-color: #7dff5d96;
  --el-table-text-color: var(--el-text-color-primary);
}
 
.t-row {
  cursor: pointer;
  background-color: transparent !important;
}
 
.t-cell {
  /* background: red !important; */
  /* height: 40px;
  border: 1px solid black; */
  text-align: center !important;
}
 
.t-header-row {
}
 
.t-header-cell {
  /* background-color: var(--bg-color-2) !important; */
  text-align: center !important;
  color: var(--el-text-color-primary) !important;
}
</style>