Commit d2bf561f authored by Cai Wei's avatar Cai Wei

feat(*): 表格新增测试标记

parent 4b32bc3e
......@@ -11,14 +11,17 @@
<template v-for="column in columns" :key="column.prop">
<el-table-column v-bind="column" :align="align">
<template #default="scope">
<slot
:name="column.prop"
v-bind="scope"
:row="scope.row"
:column="column"
>
{{ scope.row[column.prop] }}
</slot>
<!-- 在每个td里包一层span,追加唯一的 data-testid -->
<span :data-testid="`cell-${scope.$index}-${column.prop}`">
<slot
:name="column.prop"
v-bind="scope"
:row="scope.row"
:column="column"
>
{{ scope.row[column.prop] }}
</slot>
</span>
</template>
</el-table-column>
</template>
......@@ -43,6 +46,7 @@
</div>
</template>
<script setup>
import { ref, computed, watch, onMounted, onUnmounted, nextTick } from "vue";
......@@ -225,7 +229,6 @@ watch(
}
}
</style>
<<<<<<< HEAD
<style lang="scss">
.el-table__header,
......@@ -244,5 +247,3 @@ watch(
}
}
</style>
=======
>>>>>>> 14bd703db4380d50659b719495c761ed24c2c0d5
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment