绑定以下两个属性
代码
:header-cell-style=“{‘border’: ‘none’,‘background’ : ‘#ffffff’}” :cell-style=“{‘border’: ‘none’}”
<el-table :header-cell-style="{
'border': 'none','background' : '#ffffff'}" :cell-style="{
'border': 'none'}" height=320 :data="rankList" style="width: 100%;"> <el-table-column prop="name" label="名称" width="150px"> </el-table-column> <el-table-column label="季收益" width=""> <template slot-scope="scope"> <span class="profit-font" :style="{
'color':scope.row.quarterProfit > 0 ? '#F21C1C' : '#13D838'}">{
{ scope.row.quarterProfit }}%</span>
</template>
</el-table-column>
<el-table-column prop="todayProfit" label="今日收益">
<template slot-scope="scope">
<span class="profit-font" :style="{
'color':scope.row.todayProfit > 0 ? '#F21C1C' : '#13D838'}">{
{ scope.row.todayProfit }}%</span>
</template>
</el-table-column>
</el-table>
注
示例直接使用Object数据