Skip to content

Commit

Permalink
fix: Add key to v-for (#1369)
Browse files Browse the repository at this point in the history
  • Loading branch information
keng0o authored and ktsn committed Sep 1, 2018
1 parent 0a04c46 commit a9bd047
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion examples/shopping-cart/components/ProductList.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<template>
<ul>
<li v-for="product in products">
<li
v-for="product in products"
:key="product.id">
{{ product.title }} - {{ product.price | currency }}
<br>
<button
Expand Down
4 changes: 3 additions & 1 deletion examples/shopping-cart/components/ShoppingCart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
<h2>Your Cart</h2>
<p v-show="!products.length"><i>Please add some products to cart.</i></p>
<ul>
<li v-for="product in products">
<li
v-for="product in products"
:key="product.id">
{{ product.title }} - {{ product.price | currency }} x {{ product.quantity }}
</li>
</ul>
Expand Down

0 comments on commit a9bd047

Please sign in to comment.