mirror of
https://github.com/LiuYuYang01/ThriveX-Blog.git
synced 2026-06-09 16:52:35 +08:00
在分类页面中添加排序功能,确保分类列表按照指定顺序排列;在类型定义中为Cate接口新增order属性以支持排序。
This commit is contained in:
@@ -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>
|
||||
|
||||
1
src/types/app/cate.d.ts
vendored
1
src/types/app/cate.d.ts
vendored
@@ -6,6 +6,7 @@ export interface Cate {
|
||||
icon: string,
|
||||
level: number,
|
||||
type: string,
|
||||
order: number,
|
||||
children: Cate[]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user