data() {
return {
clientHeight: document.documentElement.clientHeight,
computed: {
tableHeight: function () {
return this.clientHeight - 420;
},
}
mounted() {
this.GetTableData(this.pageObj);
window.onresize = () => {
this.clientHeight = document.documentElement.clientHeight;
};
},
<el-table
:data="tableData"
:header-cell-style="{
backgroundColor: '#123121',
color: '#33113',
fontSize: '14px',
fontWeight: 'semibold',
}"
:style="{ minHeight: tableHeight + 'px' }"
max-height="560px"
>
changeStatus
<el-table-column
label="学习状态"
prop="status"
align="left"
width="120"
>
<template slot-scope="scope"
:style中颜色使用函数动态获取赋值
最新推荐文章于 2024-07-09 15:59:19 发布