Merge branch 'docs/update-vue-naming-guidelines' into 'master'
Update vue component naming guidelines See merge request gitlab-org/gitlab-ce!17018
This commit is contained in:
commit
d997fe135b
2 changed files with 10 additions and 5 deletions
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Update vue component naming guidelines
|
||||
merge_request: 17018
|
||||
author: George Tsiolis
|
||||
type: other
|
|
@ -302,20 +302,20 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation.
|
|||
|
||||
#### Naming
|
||||
1. **Extensions**: Use `.vue` extension for Vue components.
|
||||
1. **Reference Naming**: Use camelCase for their instances:
|
||||
1. **Reference Naming**: Use PascalCase for their instances:
|
||||
```javascript
|
||||
// bad
|
||||
import CardBoard from 'cardBoard'
|
||||
import cardBoard from 'cardBoard.vue'
|
||||
|
||||
components: {
|
||||
CardBoard:
|
||||
cardBoard,
|
||||
};
|
||||
|
||||
// good
|
||||
import cardBoard from 'cardBoard'
|
||||
import CardBoard from 'cardBoard.vue'
|
||||
|
||||
components: {
|
||||
cardBoard:
|
||||
CardBoard,
|
||||
};
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in a new issue