Vue3:How to pass updated props to child component

Viewed 19

I'm trying to figure out how to pass updated props to child component. For example,

// parent component
// temp is an reactive object
<Child :temp="temp">

and in Child component,when temp gets modified, the temp props isn't changed.

I'm using script-setup in vue3.

Can you please help me with this issue?

1 Answers

Are you modifying temp in child component? You should avoid manipulation of props.

Otherwise: Are you assigning temp to another variable? It's easy to lose reactivity when doing so, I have learned.

If you provide a little more context your question might get more helpful answers.

Related