vue+el动态列
文章目录
效果图

后端返回の数据结构
返回的result.labelList是动态label。result.list,包含所有数据,其中labelMap是动态列的键值对结果。
前端HTML
*template很重要~~
<el-table-column
v-for="label in labelArr"
:key="label"
:label="label"
>
<template slot-scope="scope">
<span>{{ scope.row.labelMap[label] }}</span>
</template>
</el-table-column>前端JS
this.labelArr = [];
this.$set(this, "labelArr", res.result.labelList);
this.$set(this, `${which}`, res.result.list);
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论