table表格中的进度条
<template>
<div class="header">
<el-table
:data="tabelData"
:header-cell-style="rowClass"
:cell-style="cellStyle"
>
<el-table-column
prop="name"
label="名称"
align="center"
width="80"
></el-table-column>
<el-table-column prop="num" label="特征重要性" align="center" sortable="">
<template slot-scope="scope">
<el-progress
type="line"
:percentage="scope.row.num * 100"
:format="format(scope.row, scope.column)"
color="#3c79f2"
:text-inside="false"
:stroke-width="12"
/>
</template>
</el-table-column>
</el-table>
</template>
<script>
export default {
name: "bostTable",
props: {
data: {
type: Object,
},
},
data() {
return {
tabelData: [
{
date: "featture1",
num: 1,
},
{
date: "featture2",
num: 0.7,
},
{
date: "featture3",
num: 0.5,
},
{
date: "featture4",
num: 0.8,
},
],
};
},
components: {
Search,
},
created() {
},
mounted() {},
methods: {
rowClass({ row, rowIndex }) {
return "background:#3c79f2; color:#fff";
},
format(row, column) {
return () => {
if (column.label === "特征重要性") {
return row.num + "";
}
};
},
//设置指定行、列、具体单元格颜色
cellStyle({ row, column, rowIndex, columnIndex }) {
// console.log(rowIndex, columnIndex);
// if (columnIndex === 0) {
// //指定坐标rowIndex :行,columnIndex :列
// return "background:red"; //rgb(105,0,7)
// } else {
// return "";
// }
},
},
};
</script>
<style lang='scss' scoped>
.main-content-box {
border: solid 1px #000;
}
#svg-canvas {
padding-top: 20px;
}
</style>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)