Commit 6d842cf1 authored by xhx's avatar xhx

消息排序

parent 2ef4f9e7
...@@ -159,6 +159,7 @@ export default defineComponent({ ...@@ -159,6 +159,7 @@ export default defineComponent({
const ret = await queryNotifyList({ notify_type: "1" }); const ret = await queryNotifyList({ notify_type: "1" });
if (ret.code === 200) { if (ret.code === 200) {
const list = ret.data.items; const list = ret.data.items;
list.sort((a, b) => b.created_at - a.created_at)
this.notifyList = list; this.notifyList = list;
} }
}, },
......
...@@ -22,6 +22,7 @@ export default defineComponent({ ...@@ -22,6 +22,7 @@ export default defineComponent({
const notifyList = () => { const notifyList = () => {
getNotifyList(type).then(res => { getNotifyList(type).then(res => {
list.value = res.data.items list.value = res.data.items
list.value.sort((a: {created_at: number}, b: {created_at: number}) => b.created_at - a.created_at)
}) })
} }
notifyList() notifyList()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment