Next.js template
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

sortHelpers.js 244B

1234567891011
  1. export const compare = (a, b, sort) => {
  2. if (sort === 'asc') {
  3. if (a > b) return 1;
  4. else if (b > a) return -1;
  5. return 0;
  6. } else if (sort === 'desc') {
  7. if (a > b) return -1;
  8. else if (b > a) return 1;
  9. return 0;
  10. }
  11. };