File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 11<template >
22 <div class =" ajax-table" >
3- <el-table v-loading =" loading" :data =" tableData" >
3+ <el-table
4+ v-loading =" loading"
5+ :data =" tableData"
6+ :default-sort =" default_sort"
7+ >
48 <el-table-column
59 v-for =" item in columns"
610 :key =" item"
913 :width =" item.width"
1014 :align =" item.align"
1115 :header-align =" item.headerAlign"
16+ :sortable =" item.sortable"
1217 />
1318 </el-table >
1419 <el-pagination
@@ -87,6 +92,9 @@ export default {
8792 process: {
8893 type: Function ,
8994 default : x => x
95+ },
96+ default_sort: {
97+
9098 }
9199 },
92100};
Original file line number Diff line number Diff line change 4646 :limit =" limit"
4747 :total =" data_count"
4848 :process =" process"
49+ :default_sort =" {prop: 'pid', order: 'ascending'}"
4950 />
5051 </el-card >
5152 </div >
@@ -69,19 +70,23 @@ export default {
6970 name: ' score' ,
7071 label: ' Status' ,
7172 width: ' 120' ,
72- align: ' center'
73+ align: ' center' ,
74+ sortable: true
7375 }, {
7476 name: ' pid' ,
7577 label: ' Problem ID' ,
7678 width: ' 120' ,
77- align: ' center'
79+ align: ' center' ,
80+ sortable: true
7881 }, {
7982 name: ' title' ,
80- label: ' Title'
83+ label: ' Title' ,
84+ sortable: false
8185 }, {
8286 name: ' tag' ,
8387 width: ' 400' ,
8488 align: ' right' ,
89+ sortable: false
8590 }],
8691 data_count: 10
8792 };
You can’t perform that action at this time.
0 commit comments