根据data参数动态修改样式百分比样式。
<el-table-column prop="address" label="占比" align="center">
<template slot-scope="scope">
<div>{{scope.row.hundred}}</div>
<div class="proportion">
<div class="proportion_percent" :style="{'width': scope.row.hundred}"></div>
</div>
</template>
</el-table-column>
js:
data: function () {
return {
tableData: [{
date: '1',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
hundred: '60%',
people: '56',
}, {
date: '2',
name: '急诊科',
address: '上海市普陀区金沙江路 1518 弄',
hundred: '30%',
people: '89',
}]
}
},