vuejs / Discussion

Vue.js discussion
167 stars 17 forks source link

Why does Dom not syn with data when render with v-for #1285

Open coblan opened 7 years ago

coblan commented 7 years ago

code address: https://jsfiddle.net/pvmzcchn/1

There are two Array in the script above.When click the button,data switch between Arrays.But second 's background-color is always grey. I have try adding v-for :key='image.url', then it works, when adding :key='image.label' ,if fail. Although have read the doc,there still are a lot of unclear place in list render of Vuejs. spcially with v-if and v-else

Plese someone can explain?why