快速开始

没耐心?

如果你迫不及待想开始,可以直接克隆并运行基础示例,执行以下命令:

bash
npx degit https://github.com/tanstack/router/examples/solid/start-basic start-basic
cd start-basic
npm install
npm run dev
npx degit https://github.com/tanstack/router/examples/solid/start-basic start-basic
cd start-basic
npm install
npm run dev

如果想使用其他示例,只需将上述命令中的 start-basic 替换为下方列表中你想要的示例名称。

克隆完目标示例后,返回基础教程学习如何使用 TanStack Start!

示例项目

TanStack Start 提供了丰富的示例项目助你快速上手。从以下示例中选择一个开始吧:

Stackblitz 预览

每个示例都嵌入了 Stackblitz 在线预览功能,方便你找到最适合的起点

快速部署

点击示例页面上的 Deploy to Netlify 按钮,即可将示例克隆并一键部署到 Netlify 平台

手动部署

若需手动克隆并部署到其他平台,请使用以下命令(将 EXAMPLE_SLUG 替换为上方示例名称):

bash
npx degit https://github.com/tanstack/router/examples/solid/EXAMPLE_SLUG my-new-project
cd my-new-project
npm install
npm run dev
npx degit https://github.com/tanstack/router/examples/solid/EXAMPLE_SLUG my-new-project
cd my-new-project
npm install
npm run dev

完成克隆或部署后,记得返回基础教程学习 TanStack Start 的使用方法!

其他路由示例

虽然不是 Start 专属示例,但这些项目能帮助你深入理解 TanStack Router 的工作原理:

Subscribe to Bytes

Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.

Bytes

No spam. Unsubscribe at any time.