Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
6f040230
Commit
6f040230
authored
May 04, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes after review
parent
1848ddf6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
19 deletions
+13
-19
doc/development/fe_guide/style_guide_js.md
doc/development/fe_guide/style_guide_js.md
+13
-19
No files found.
doc/development/fe_guide/style_guide_js.md
View file @
6f040230
...
...
@@ -225,13 +225,6 @@ A forEach will cause side effects, it will be mutating the array being iterated.
### Vue.js
#### Basic Rules
1.
Only include one Vue.js component per file.
1.
Export components as plain objects:
```
javascript
export
default
{
template
:
`<h1>I'm a component</h1>
}
```
1.
The service has it's own file
1.
The store has it's own file
1.
Use a function in the bundle file to instantiate the Vue component:
...
...
@@ -274,22 +267,13 @@ A forEach will cause side effects, it will be mutating the array being iterated.
#### Naming
1.
**Extensions**
: Use
`.vue`
extension for Vue components.
1.
**Reference Naming**
: Use
PascalCase for Vue components and
camelCase for their instances:
1.
**Reference Naming**
: Use camelCase for their instances:
```
javascript
// bad
import
cardBoard
from
'
cardBoard
'
;
// good
import
C
ardBoard
from
'
cardBoard
'
import
c
ardBoard
from
'
cardBoard
'
// bad
components
:
{
CardBoard
:
CardBoard
};
// good
components
:
{
cardBoard
:
CardBoard
cardBoard
:
};
```
...
...
@@ -495,6 +479,16 @@ A forEach will cause side effects, it will be mutating the array being iterated.
1.
Tooltips: When using a tooltip, include the tooltip mixin
1.
Don't change
`data-original-title`
.
```
javascript
// bad
<
span
data
-
original
-
title
=
"
tooltip text
"
>
Foo
<
/span
>
// good
<
span
title
=
"
tooltip text
"
>
Foo
<
/span
>
$
(
'
span
'
).
tooltip
(
'
fixTitle
'
);
```
## SCSS
-
[
SCSS
](
style_guide_scss.md
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment