File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 2424 border
2525 fit
2626 highlight-current-row
27- style =" width : 100% ;" >
28- <el-table-column :label =" $t('table.id')" align =" center" width =" 65" >
27+ style =" width : 100% ;"
28+ @sort-change =" sortChange" >
29+ <el-table-column :label =" $t('table.id')" prop =" id" sortable =" custom" align =" center" width =" 65" >
2930 <template slot-scope="scope">
3031 <span >{{ scope.row.id }}</span >
3132 </template >
@@ -233,6 +234,20 @@ export default {
233234 })
234235 row .status = status
235236 },
237+ sortChange (data ) {
238+ const { prop , order } = data
239+ if (prop === ' id' ) {
240+ this .sortByID (order)
241+ }
242+ },
243+ sortByID (order ) {
244+ if (order === ' ascending' ) {
245+ this .listQuery .sort = ' +id'
246+ } else {
247+ this .listQuery .sort = ' -id'
248+ }
249+ this .handleFilter ()
250+ },
236251 resetTemp () {
237252 this .temp = {
238253 id: undefined ,
You can’t perform that action at this time.
0 commit comments