跳至內容

類型化路由

此 API 目前處於實驗階段,日後可能會有變動。

實驗性支援靜態類型連結。此功能需要在您的專案中使用 App Router 以及 TypeScript。

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