1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <template>
- <div>
- <el-table :data="resultList" style="width: 100%">
- <el-table-column v-for="(item,index) in keyList" :key="index" align="center" :label="item" :prop="item">
- </el-table-column>
- </el-table>
- </div>
- </template>
- <script>
- export default {
- name: 'delAbnormalResult',
- props: ['resultList'],
- data() {
- return {
- keyList: [],
- }
- },
- created() {
- this.init()
- },
- methods: {
- init() {
- this.keyList = Object.keys(this.resultList[0])
- },
- cellClassName(data) {
- const { columnIndex, rowIndex } = data
- // console.log(rowIndex,columnIndex);
- if (!this.resultList[rowIndex][columnIndex]) {
- return 'red-background'
- }
- },
- },
- }
- </script>
- <style scoped>
- ::v-deep .el-table__row .red-background {
- background-color: red;
- }
- </style>
|