Next.js 文档
¥Next.js Docs
欢迎阅读 Next.js 文档!
¥Welcome to the Next.js documentation!
什么是 Next.js?
¥What is Next.js?
Next.js 是一个用于构建全栈 Web 应用的 React 框架。你使用 React 组件构建用户界面,并使用 Next.js 实现其他功能和优化。
¥Next.js is a React framework for building full-stack web applications. You use React Components to build user interfaces, and Next.js for additional features and optimizations.
它还会自动配置打包器和编译器等底层工具。你可以专注于构建产品并快速发布。
¥It also automatically configures lower-level tools like bundlers and compilers. You can instead focus on building your product and shipping quickly.
无论你是个人开发者还是大型团队的一部分,Next.js 都可以帮助你构建交互式、动态且快速的 React 应用。
¥Whether you're an individual developer or part of a larger team, Next.js can help you build interactive, dynamic, and fast React applications.
如何使用文档
¥How to use the docs
文档分为 4 个部分:
¥The docs are organized into 4 sections:
入门:分步教程,帮助你创建新应用并学习 Next.js 的核心功能。
¥Getting Started: Step-by-step tutorials to help you create a new application and learn the core Next.js features.
指南:特定用例的教程,请选择与你相关的内容。
¥Guides: Tutorials on specific use cases, choose what's relevant to you.
API 参考:每个功能的详细技术参考。
¥API Reference: Detailed technical reference for every feature.
使用侧边栏浏览各个部分,或搜索(Ctrl+K
或 Cmd+K
)快速查找页面。
¥Use the sidebar to navigate through the sections, or search (Ctrl+K
or Cmd+K
) to quickly find a page.
应用路由和页面路由
¥App Router and Pages Router
Next.js 有两个不同的路由:
¥Next.js has two different routers:
应用路由:支持服务器组件等 React 新功能的较新路由。
¥App Router: The newer router that supports new React features like Server Components.
页面路由:原始路由,仍然受支持并正在改进。
¥Pages Router: The original router, still supported and being improved.
在侧边栏顶部,你会看到一个下拉菜单,可用于在 应用路由 和 页面路由 文档之间切换。
¥At the top of the sidebar, you'll notice a dropdown menu that allows you to switch between the App Router and the Pages Router docs.
必备知识
¥Pre-requisite knowledge
我们的文档假设你对 Web 开发有一定的了解。开始之前,如果你熟悉以下内容会有所帮助:
¥Our documentation assumes some familiarity with web development. Before getting started, it'll help if you're comfortable with:
HTML
CSS
JavaScript
React
如果你是 React 新手或需要复习,我们建议你从 React 基础课程 开始,然后使用 Next.js 基础课程 来构建应用。
¥If you're new to React or need a refresher, we recommend starting with our React Foundations course, and the Next.js Foundations course that has you building an application as you learn.
无障碍
¥Accessibility
为了在使用屏幕阅读器时获得最佳体验,我们建议使用 Firefox 和 NVDA,或 Safari 和 VoiceOver。
¥For the best experience when using a screen reader, we recommend using Firefox and NVDA, or Safari and VoiceOver.
加入我们的社区
¥Join our Community
如果你对 Next.js 有任何疑问,欢迎随时在 GitHub 讨论、Discord、X (Twitter) 和 Reddit 上向我们的社区提问。
¥If you have questions about anything related to Next.js, you're always welcome to ask our community on GitHub Discussions, Discord, X (Twitter), and Reddit.