8000 `component.md` : Component Naming Conventions better consistency by MachinisteWeb · Pull Request #903 · vuejs/v2.vuejs.org · GitHub
[go: up one dir, main page]

Skip to content

component.md : Component Naming Conventions better consistency #903

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

Merged
merged 6 commits into from
May 19, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/v2/guide/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -1155,25 +1155,25 @@ When using _string_ templates however, we're not bound by HTML's case-insensitiv

- kebab-case
- camelCase or kebab-case if the component has been defined using camelCase
- kebab-case, camelCase or Title case if the component has been defined using TitleCase
- kebab-case, camelCase or TitleCase if the component has been defined using TitleCase

``` js
components: {
'kebab-case-component': { /* ... */ },
camelCaseComponent: { /* ... */ },
TitleCaseComponent: { /* ... */ }
'kebab-cased-component': { /* ... */ },
camelCasedComponent: { /* ... */ },
TitleCasedComponent: { /* ... */ }
}
```

``` html
<kebab-case-component />
<kebab-cased-component></kebab-cased-component>

<camel-case-component />
<camelCaseComponent />
<camel-cased-component></camel-cased-component>
<camelCasedComponent></camelCasedComponent>

<title-case-component />
<titleCaseComponent />
<TitleCaseComponent />
<title-cased-component></title-cased-component>
<titleCasedComponent></titleCasedComponent>
<TitleCasedComponent></TitleCasedComponent>
```

This means that the TitleCase is the most universal _declaration convention_ and kebab-case is the most universal _usage convention_.
Expand Down
0