主题
¥Examples
¥Data Fetching
使用 fetch API
fetch
¥Using the fetch API
使用 ORM 或数据库客户端
¥Using an ORM or database client
在服务器上读取搜索参数
¥Reading search params on the server
在客户端上读取搜索参数
¥Reading search params on the client
¥Revalidating Data
使用 ISR 在一定时间后重新验证数据
¥Using ISR to revalidate data after a certain time
使用 ISR 按需重新验证数据
¥Using ISR to revalidate data on-demand
¥Forms
提交表单时显示待处理状态
¥Showing a pending state while submitting a form
服务器端表单验证
¥Server-side form validation
处理预期错误
¥Handling expected errors
处理意外异常
¥Handling unexpected exceptions
显示乐观的 UI 更新
¥Showing optimistic UI updates
程序化表单提交
¥Programmatic form submission
¥Server Actions
传递附加值
¥Passing additional values
重新验证数据
¥Revalidating data
重定向
¥Redirecting
设置 cookie
¥Setting cookies
删除 cookies
¥Deleting cookies
¥Metadata
创建 RSS 源
¥Creating an RSS feed
创建 Open Graph 图片
¥Creating an Open Graph image
创建站点地图
¥Creating a sitemap
创建 robots.txt 文件
¥Creating a robots.txt file
创建自定义 404 页面
¥Creating a custom 404 page
创建自定义 500 页面
¥Creating a custom 500 page
¥Auth
创建注册表单
¥Creating a sign-up form
无状态、基于 cookie 的会话管理
¥Stateless, cookie-based session management
有状态、数据库支持的会话管理
¥Stateful, database-backed session management
管理授权
¥Managing authorization
¥Testing
Vitest
Jest
Playwright
Cypress
¥Deployment
创建 Dockerfile
¥Creating a Dockerfile
创建静态导出 (SPA)
¥Creating a static export (SPA)
自托管时配置缓存
¥Configuring caching when self-hosting
自托管时配置图片优化
¥Configuring Image Optimization when self-hosting