<template>
<el-table-column v-for="sh in headers" :prop="sh.uploadCode" align="center" header-align="center"
:label="sh.uploadName+((sh.measureUnit==null||sh.measureUnit=='')?'':('('+sh.measureUnit+')'))" min-width="50">
<template slot-scope="scope">
<div v-if="sh.factorType==1" :class="'cellBg_'+scope.row['TAG_'+sh.factorCode]">
<span>{{scope.row[sh.uploadCode]}}</span>
</div>
</template>
</el-table-column>
</template>
<script>
export default {
data() {//初始属性方法
return {
headers: [],
}
}
}
</script>
<style lang="less" scoped>
.cellBg_1 { // 标颜色
height: 100%;
width: 100%;
display: flex;
color: red;
justify-content: center;
align-items: center;
}
</style>
vue+element 表头循环出列
最新推荐文章于 2024-09-02 02:34:33 发布