数据库中每个列名称有字段名为sortable为ture或者false来控制这个列是否需要排序,给有需要排序的列加上element-ui中的上下箭头按钮,并根据点击的列去传参数到后端,后端进行排序后返回。
1.给table 组件添加自拟函数属性
<el-table
:data="data"
border
style="width:100%"
v-loading="loading"
@select="handleSelect"
:header-cell-style="headerStyle"
:cell-