Vue not updating ARRAY properly using unshift Vue not updating ARRAY properly using unshift laravel laravel

Vue not updating ARRAY properly using unshift


The main issue here is that when you are looping over a component, you are required to use a key.

In 2.2.0+, when using v-for with a component, a key is now required.

That being the case, your template should look like this:

<feed v-for="feed in feedData" :key="feed.id" :feedContent="feed"></feed> 

where feed.id is a unique value in each feed object. This is because of Vue's DOM update strategy. Using a key helps Vue identify which components need to be created/destroyed.


Are you using the key param in your template? Like this?

 :key="<An ID>"

For instance:

<div  v-for="(item, index) in array" :key="item.id">  {{index}} - {{item.name}}</div>