连字符分隔的大小写是什么名称? [英] What's the name for hyphen-separated case?

查看:133
本文介绍了连字符分隔的大小写是什么名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是PascalCase:SomeSymbol

This is PascalCase: SomeSymbol

这是骆驼案例:someSymbol

这是snake_case:some_symbol

This is snake_case: some_symbol

所以我的问题是是否有一个广为接受的名称:some-symbol?它通常在url中使用.

So my questions is whether there is a widely accepted name for this: some-symbol? It's commonly used in url's.

推荐答案

这种情况下的约定实际上并没有一个标准名称,因此应该如何称呼也有分歧.

There isn't really a standard name for this case convention, and there is disagreement over what it should be called.

也就是说,截至2019年,有充分的理由证明 kebab-case 会获胜:

That said, as of 2019, there is a strong case to be made that kebab-case is winning:

https://trends.google.com/trends/explore?date=all&q=kebab-case、spinal-case、lisp-case、dash-case、caterpillar-case

spinal-case 是遥不可及的秒,其他术语根本没有任何吸引力.

spinal-case is a distant second, and no other terms have any traction at all.

此外, kebab-case 已进入多个javascript代码库的词典,例如:

Additionally, kebab-case has entered the lexicon of several javascript code libraries, e.g.:

  • https://lodash.com/docs/#kebabCase
  • https://www.npmjs.com/package/kebab-case
  • https://vuejs.org/v2/guide/components-props.html#Prop-Casing-camelCase-vs-kebab-case

但是,人们仍然使用其他术语. Lisp已使用该约定数十年,如此Wikipedia条目中所述,人们将其描述为 lisp-case .我见过的其他一些形式包括 caterpillar-case dash-case hyphen-case ,但是这些都不是标准的.

However, there are still other terms that people use. Lisp has used this convention for decades as described in this Wikipedia entry, so some people have described it as lisp-case. Some other forms I've seen include caterpillar-case, dash-case, and hyphen-case, but none of these is standard.

因此,您的问题的答案是:不,这种情况下的约定没有一个与 snake_case camelCase 类似的广泛接受的名称. -被接受.

So the answer to your question is: No, there isn't a single widely-accepted name for this case convention analogous to snake_case or camelCase, which are widely-accepted.

这篇关于连字符分隔的大小写是什么名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆