我有这些路线要展示:
/order/product-id
/order/global
/order/local
如何隐藏导航栏/order/product-id.tsx
?我有_layout.tsx
包含导航栏。
这是我的文件夹结构
- order+
_layout.tsx ---> this contains the navigation bar
- product-id.tsx
- global.tsx
- local.tsx
我有这些路线要展示:
/order/product-id
/order/global
/order/local
如何隐藏导航栏/order/product-id.tsx
?我有_layout.tsx
包含导航栏。
这是我的文件夹结构
- order+
_layout.tsx ---> this contains the navigation bar
- product-id.tsx
- global.tsx
- local.tsx
如果您想退出父布局,通常会添加
_
后缀。由于您使用的是混合路线,因此您无法轻松地将其添加到订单布局中。为了处理这种情况,有一种未记录的方法可以做到这一点。只需将
_.
前缀添加到您的product-id.tsx 路由中即可。_.product-id.tsx
(这会将_
后缀添加到父布局中)https://github.com/kiliman/remix-flat-routes/commit/1a2e3b1cbecba2c83d05242fbd89e8e513294696