Why "VueButton" is considered a bad component name and "VButton" is not? #2510
-
"Why is "VueButton" considered a bad component name while "VButton" is not? The "Base component names" (B Rules) are not clear to me. In the detailed explanation, it says: "Since component names should always be multi-word, this convention prevents you from having to choose an arbitrary prefix for simple component wrappers (e.g., MyButton, VueButton)." Why a single letter as a prefix is not considered arbitrary? Style guide link: https://vuejs.org/style-guide/rules-strongly-recommended.html#base-component-names |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Technically single letter prefix can be considered arbitrary too. But mostly people use them to avoid naming conflicts or to better organize stuff. This is especially common with component libraries. Like vuetify uses |
Beta Was this translation helpful? Give feedback.
-
single-word component is Inconvenience. |
Beta Was this translation helpful? Give feedback.
Technically single letter prefix can be considered arbitrary too. But mostly people use them to avoid naming conflicts or to better organize stuff. This is especially common with component libraries. Like vuetify uses
v
as prefix, element plus usesel
, ant design usesa
, and so on. And in projects too (suppose it's namedFoo
), and you won't wanna have justButton
, so you will need to make every component have at least two words, and people often go withFButton
(F is the first character of Foo; people don't usually go withFooButton
as that's just longer to type).