Last active
October 29, 2018 13:41
-
-
Save christopheragnus/550fa0b688a5153883f2f9b01f0e169c to your computer and use it in GitHub Desktop.
Vuejs List Rendering
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<li v-for="item in items" :key="item.id"> {{ item }}</li> | |
// To access the position in the array: | |
<li v-for="(item, index) in items"> | |
// To iterate through objects: | |
<li v-for="(value, key) in object"> | |
// Using v-for with a component | |
<cart-product v-for="item in products" :product="item" :key="item.id"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment