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
| <template>
| <el-table :data="tableData" :column="columnss" style="width: 100%">
| <el-table-column type="index" width="50">
| <template #default="scope">
| {{ getRowIndex(scope.$index) }}
| </template>
| </el-table-column>
| <el-table-column
| v-for="(item, index) in columnss"
| :key="index"
| :prop="item.prop"
| :label="item.label"
| :align="item.align || 'center'"
| :min-width="item.minWidth || '100px'"
| :width="item.width"
| :fixed="item.fixed || false"
| :show-overflow-tooltip="showOverflowTooltip || true"
| >
| </el-table-column>
| </el-table>
| </template>
| <script setup>
| import { ref, onMounted, watch, nextTick } from "vue";
|
| const props = defineProps({
| tableData: {
| type: Array,
| default: () => [],
| },
| columnss: {
| type: Array,
| default: () => [],
| },
| });
| const getRowIndex = (index) => {
| return index + 1;
| };
| </script>
| <style scoped></style>
|
|