Subscribe on changes!

incorrect value in component when append a item by unshift

avatar
Oct 26th 2023

workaround: add a key

<div v-for = "item in list" :key="item">
avatar
Oct 26th 2023

Expected.

https://vuejs.org/guide/essentials/list.html#maintaining-state-with-key

This default mode is efficient, but only suitable when your list render output does not rely on child component state or temporary DOM state (e.g. form input values).

Stateful child components must use key to ensure correctness.