From 7152ee934701349e33962e14689033470d2ea299 Mon Sep 17 00:00:00 2001 From: imbytecat Date: Sun, 18 Jan 2026 05:18:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8Todos=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E4=B8=AD=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在Todos路由中添加加载器,确保在页面渲染前预先获取待办事项数据。 --- src/routes/todos.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/routes/todos.tsx b/src/routes/todos.tsx index 1b27c35..e370b2d 100644 --- a/src/routes/todos.tsx +++ b/src/routes/todos.tsx @@ -6,6 +6,9 @@ import { orpc } from '@/orpc' export const Route = createFileRoute('/todos')({ component: Todos, + loader: async ({ context }) => { + await context.queryClient.ensureQueryData(orpc.todo.list.queryOptions()) + }, }) function Todos() {