Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

路由 index 目录特殊规则说明 #5880

Closed
ClarkXia opened this issue Feb 8, 2023 · 0 comments
Closed

路由 index 目录特殊规则说明 #5880

ClarkXia opened this issue Feb 8, 2023 · 0 comments
Assignees

Comments

@ClarkXia
Copy link
Collaborator

ClarkXia commented Feb 8, 2023

背景

在 ice.js 3 中,约定式路由渲染规则是这样的:

路由文件 路由
src/pages/index.tsx /
src/pages/about/index.tsx /about
src/pages/about/me.tsx /about/me

遇到 index.tsx,路由地址是 /

如果要渲染比如 /index 这样的路由地址,目前 ice.js 3 中是不支持的。

调研

在 Remix 中,如果要渲染 /index,则需要把文件名命名为:

-  index.tsx
+ [index].tsx

主要是使用了该特性:https://remix.run/docs/en/v1/file-conventions/routes-files#escaping-special-characters

目前 ice.js 3 中不支持此特性。

next.js 文档未见有类似的场景说明

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants