2025-03-26

This commit is contained in:
2025-03-26 11:00:21 +08:00
parent 927d7381b8
commit b45f4950d3
468 changed files with 54473 additions and 124 deletions

14
src/hooks/useDateSort.ts Normal file
View File

@@ -0,0 +1,14 @@
export const useDateSort = (property: any, bol: any) => {
//property是你需要排序传入的key,bol为true时是升序false为降序
return function (a: any, b: any) {
let value1 = a[property];
let value2 = b[property];
if (bol) {
// 升序
return Date.parse(value1) - Date.parse(value2);
} else {
// 降序
return Date.parse(value2) - Date.parse(value1);
}
};
};