Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

aldojack's avatar

Passing data to grandchild component prop and editing value

So I have a HomeView that passes data to an item container, this then creates individual item components, my question is how would I edit this so I can have an edit, delete button on each item component which will then reflect on my inital data declared in the parent?

0 likes
3 replies
AungHtetPaing__'s avatar

@aldojack You can manage state with external file or use provide/inject. You can watch Learn Vue 3 step by step series - section 7 managing state for more detail.

1 like
Ben Taylor's avatar

If I am understanding your question properly, you would emit an event from the child to the parent when you delete and/or edit an item so as to update the data on the parent.

1 like
aldojack's avatar

@Ben Taylor So this is what I had in mind but the data is in the parent and the initial emit would be in the grandchild. I did initally try and code some sort of emit but once I was done I realised the code change for it would still be happening in the child

Please or to participate in this conversation.