So even though I have the same objects, array.includes() does not work in Vue unfortunately. My guess is that behind the scenes Vue alters the object, thus includes() sees it as a different object.
export default {
props: ['sellitem'],
data(){
return {
sells: [ this.sellitem ]
};
},
watch: {
sellitem(value){
if( ! this.sells.includes(value)) this.sells.push(value);
}
},
}
Periodically the component gets new Prop values so I add them to the array sells. But of course when something is already in the array it should not be pushed inside.