This commit is contained in:
2024-09-25 10:59:56 +08:00
parent cf87e0c28a
commit 2f5407d7b3
4 changed files with 7 additions and 1 deletions

View File

@@ -517,6 +517,7 @@ const sortTable = (e: any, key: string, sort: string, issoul = false) => {
e.target.parentNode.setAttribute("lay-sort", "");
tableDataSource.value = [...props.dataSource];
} else {
console.log("排序了");
e.target.parentNode.setAttribute("lay-sort", "desc");
tableDataSource.value.sort((x, y) => {
if (x[key] < y[key]) return 1;
@@ -529,6 +530,7 @@ const sortTable = (e: any, key: string, sort: string, issoul = false) => {
e.target.parentNode.setAttribute("lay-sort", "");
tableDataSource.value = [...props.dataSource];
} else {
console.log("排序了");
e.target.parentNode.setAttribute("lay-sort", "asc");
tableDataSource.value.sort((x, y) => {
if (x[key] < y[key]) return -1;