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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
d7b3a711
Commit
d7b3a711
authored
Feb 28, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds information about nested v-for
parent
524c3c88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
doc/development/fe_guide/style_guide_js.md
doc/development/fe_guide/style_guide_js.md
+18
-0
No files found.
doc/development/fe_guide/style_guide_js.md
View file @
d7b3a711
...
@@ -586,6 +586,24 @@ When using `v-for` you need to provide a *unique* `:key` attribute for each item
...
@@ -586,6 +586,24 @@ When using `v-for` you need to provide a *unique* `:key` attribute for each item
</template>
</template>
```
```
1.
When dealing with nested
`v-for`
use the same guidelines as above.
```
html
<div
v-for=
"item in items"
:key=
"item.id"
>
<span
v-for=
"element in array"
:key=
"element.id"
>
<!-- content -->
</span>
</div>
```
*
Do not reuse the parent
`:key`
in the nested
`v-for`
Useful links:
Useful links:
1.
[
`key`
](
https://vuejs.org/v2/guide/list.html#key
)
1.
[
`key`
](
https://vuejs.org/v2/guide/list.html#key
)
1.
[
Vue Style Guide: Keyed v-for
](
https://vuejs.org/v2/style-guide/#Keyed-v-for-essential
)
1.
[
Vue Style Guide: Keyed v-for
](
https://vuejs.org/v2/style-guide/#Keyed-v-for-essential
)
...
...
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