关键代码
<el-table-column header-align="center" align="center" v-for="item in notFixedData" :key="item.prop"
v-if="item.isTrue" :prop="item.prop" :label="item.title" :min-width="item.width">
<template slot-scope="scope">
<span v-if="scope.row[item.prop] !== '缺'">{{scope.row[item.prop]}}</span>
<span v-else style="color: red;">{{scope.row[item.prop]}}</span>
</template>
</el-table-column>
这篇博客详细介绍了如何在Vue.js项目中利用Element UI库动态渲染表格数据。通过v-for指令遍历数据,设置表格列的对齐方式、宽度以及条件样式展示,实现了表格内容的完整展示。对于缺失数据的情况,使用了特殊样式进行高亮提示。
944

被折叠的 条评论
为什么被折叠?



