修改前:
<el-table-column
sortable
label="支付日期"
width="300"
align="center"
>
<template #default="scope">
<i class="el-icon-time"></i> //时间图标
<span style="margin-left: 10px">{{ scope.row.date }}</span>
</template>
</el-table-column>
问题:尽管用了template,但如果要用sortable的话,还是需要给<el-table-column>加上prop属性的 QAQ
修改后:
<el-table-column
sortable
label="支付日期"
prop="date" //<---------这个加上就好了嗷~
width="300"
align="center"
>
<template #default="scope">
<i class="el-icon-time"></i>
<span style="margin-left: 10px">{{ scope.row.date }}</span>
</template>
</el-table-column>