I am trying to add some more properties to each posts
data object, posts
also has several other fields like links
that I do not need to update…
const props = defineProps({
posts: {
type: Object,
required: true,
},
});
const localPosts = props.posts;
localPosts.data.map((post) => {
return {
...post,
label: 'new value here',
};
});
It logs fine with the updated label, but causes random errors in my application, such as Unhandled error during execution of watcher callback
.
If I remove the mapping, no issues.
Could someone please show me how I can receive an array of objects as a prop and add new values?