Skip to content

Commit 4e0c051

Browse files
newest in the first place (#278)
1 parent 683702d commit 4e0c051

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const blogs: Blog[] = blogsData as Blog[];
2727
function Them() {
2828
// 计算将最后5个项目前置的数组,并标记这些“最新”项
2929
const sliceCount = Math.min(5, blogs.length);
30-
const lastN = blogs.slice(-sliceCount);
30+
const lastN = blogs.slice(-sliceCount).reverse(); // 反转最新5条,使最新的在最前面
3131
const rest = blogs.slice(0, blogs.length - sliceCount);
3232
const arranged: Blog[] = [...lastN, ...rest];
3333
const toKey = (b: Blog) => `${b.name}|${b.url}`;

0 commit comments

Comments
 (0)