typedRoutes
此功能目前为实验性功能,可能会发生变化,不建议用于生产环境。请尝试使用并在 GitHub 上分享您的反馈。
实验性支持 静态类型链接。此功能需要使用 App Router 以及项目中的 TypeScript。
next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
typedRoutes: true,
},
}
module.exports = nextConfig
这对您有帮助吗?