vue3 element-ui的插槽使用(scope)
el-table 使用插槽举例
自定义表格的一项内容
<el-table-column prop="name1" label="状态" >
<template #default="scope">
<span> </span>
<span class="dot" :class="scope.row.name1=='进行中'?'green':scope.row.name1=='已取消'?'glay':scope.row.name1=='待接单'?'blue':''"></span>
<span>{{scope.row.name1}}</span>
</template>
</el-table-column>
样式
.dot{
content: "";
display: "";
width:10px;
height: 10px;
background: black;
position: absolute;
left: 5px;
top:14px;
border-radius: 50%;
}
.green{
background: rgb(43, 194, 43);
}
.blue{
background: #67b7dc;
}
.glay{
background: #dddddd;
}
.red{
color:red;
}
表单信息是dataList

# 效果如下
