在分类页面中添加排序功能,确保分类列表按照指定顺序排列;在类型定义中为Cate接口新增order属性以支持排序。

This commit is contained in:
神秘人
2025-04-03 20:42:01 +08:00
parent ca0e2438cb
commit 0fab87e7b7
2 changed files with 3 additions and 0 deletions

View File

@@ -27,6 +27,8 @@ export default async (props: Props) => {
const id = cateList.find(item => item.mark === cate)?.id!
const { data: tallList } = (await getCateWallListAPI(id, page)) || { data: {} as Paginate<Wall[]> }
cateList.sort((a, b) => a.order - b.order);
return (
<>
<title></title>

View File

@@ -6,6 +6,7 @@ export interface Cate {
icon: string,
level: number,
type: string,
order: number,
children: Cate[]
}