跳到内容

typedRoutes

此功能目前为实验性功能,可能会发生变化,不建议在生产环境中使用。欢迎试用并在 GitHub 上分享您的反馈。

实验性支持 静态类型链接。此功能需要使用 App Router 以及项目中的 TypeScript。

next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
  experimental: {
    typedRoutes: true,
  },
}
 
module.exports = nextConfig