bug04: 总金额计算,el-table-column前两项相加

255 阅读1分钟

(1)最终代码如下

 <el-table-column prop="" min-width="150" label="总金额" show-overflow-tooltip align="center" sortable>     <template slot-scope="{ row }">{{ row.remainAmount + row.rechargeAmount }}</template> </el-table-column>

(2)思路:

使用插槽v-slot

效果

(3)会出现的问题

sortable无法使用: 原因为sortable是根据prop设置的字段进行的排序,我们这种方法没有prop传值