目录
Html
样式
方法
Html
<el-table-column prop="status" label="数据状态" header-align="center" width="200">
<template slot-scope="scope">
<div style="display: flex; justify-content: center; align-items: center;">
<span slot="reference" style=" margin-right: 8px;">
<i class="dotClass" :style="getColor(scope.row.status)"></i>
</span>
{{ paramFormat(scope.row.status) }}
</div>
</template>
</el-table-column>
样式
.dotClass {
width: 12px;
height: 12px;
border-radius: 50%;
display: block;
}
方法
getColor(data) {
if (data == "one") {
return "#67C23A";
} else if (data == "two") {
return "#F56C6C";
}
...
},
有用请点赞,养成良好习惯!
疑问、交流、鼓励请留言!