1
placeholder 110 天前
如果这个路由最终会被用户看见的话,我选择大驼峰。
|
![]() |
2
rv54ntjwfm3ug8 OP @placeholder #1 可以解释一下原因吗,很少见到路由是大驼峰的网站
|
![]() |
3
Itoktsnhc 110 天前
|
![]() |
4
rioshikelong121 110 天前 ![]() https://boldist.co/search-engine-marketing/how-to-write-a-slug/
> best practices. Don’t Capitalize Letters While slugs can use capitalized letters, keeping them all lowercase looks better and breeds consistency. It also prevents typos and broken links when case sensitivity is prevalent. |
5
quan01994 110 天前
我用的 Pascal
|
6
thinkershare 110 天前
Action 的名字按照正常 Pascal 规则.
最终路由输出规范化为: user-info/follow, 路由单词全部规范化为小写. query string 按照实际需要保留大小写. |
![]() |
7
tabris17 110 天前
别用下划线我都能接受
|
8
forgottencoast 110 天前
“自动生成的路由的话用不了中划线”
自动生成也是程序做的,如果默认的组件实现不了想要的功能,可以自己写一个替换掉。 |
![]() |
9
rv54ntjwfm3ug8 OP @tabris17 #7 为什么不用下划线,看到你这条回复前 1 分钟在看 GitLab 的路由是下划线,在考虑用不用下划线
|
![]() |
11
tabris17 110 天前
@theklf4 另外对 SEO 来说,"-"比"_"好,google 等搜索引擎会把 word1_word2 当作一个词,而 word1-word2 拆分成两个词
|
12
skinny 110 天前
URL 要么 PascalCase 要么全小写+中划线,其它都不伦不类的
|
13
placeholder 110 天前
@theklf4 小驼峰还没有中划线,那阅读性没有大驼峰强,所以选择大驼峰,可以实现全小写字母加中划线的话当然更好了
|
![]() |
14
juzipeek 110 天前
windows 路径不区分大小写
|