【vue】【element】el-table列表中设计一个颜色块
使用style
中的background
加载对应颜色。
<el-table-column class="bj" prop="color" label="颜色" width="50">
<template class="bj" slot-scope="scope" style="text-align:center">
<div :style="{'background':scope.row.color}" style="width:10px;height:10px;margin: 0 auto"></div>
</template>
</el-table-column>