我正在使用 NextJs 14(应用程序路由器版本)。我想为主应用程序创建一个登录和注册页面布局以及一个单独的布局。我的根布局看起来像这样
export default function RootLayout({ children }) {
return (
<html lang="en">
<body className={rubik.className} >
<Providers>
{children}
</Providers>
</body>
</html>
);
}
我有另一个布局app/overview
。现在,如果我为登录和注册页面制作此 RootLayout 布局,它将出现在应用程序布局中。我怎样才能将它分开?我怎样才能有两个不重叠的布局
app/layout.tsx
应用程序共享根目录如下:(this-structure)
in app 的文件夹,然后将login
和添加register
到其中。这称为路由组。了解有关路线组的更多信息: https://nextjs.org/docs/app/building-your-application/routing/route-groups