[Vuejs]-Is it idiomatic to update a property of a prop, without an event?

0👍

It is idiomatic for props to flow down and events to flow up.

when the parent property updates, it will flow down to the child, but
not the other way around. This prevents child components from
accidentally mutating the parent’s state, which can make your app’s
data flow harder to reason about.

In the case of the v-for, yes, you would need to indicate the index of the item so the parent could take appropriate action on it. Depending on what you’re doing, exactly, you might also catch the native input event in the parent and process it there, so that the child component is not involved in the transaction.

Leave a comment