Skip to content

Not sure how to properly approach defineModel with objects #10538

You must be logged in to vote

No. We have 2 options: mutating nested properties of props directly or updating reference to the defineModel's model by shallow copying the original model and reassigning it.

I prefer the 1st option since it is cheaper and less boilerplate'y though against vue principals of not mutating props.

Replies: 10 comments 10 replies

You must be logged in to vote
0 replies

You must be logged in to vote
4 replies
@HassanDomeDenea

@kesoji

@xxRockOnxx

@michaelcozzolino

You must be logged in to vote
2 replies
@Gregoor

@jaypeerj

You must be logged in to vote
1 reply
@max-sistemich-kisters

You must be logged in to vote
0 replies

You must be logged in to vote
0 replies

You must be logged in to vote
0 replies

You must be logged in to vote
1 reply
@paul-geisler

You must be logged in to vote
0 replies

You must be logged in to vote
2 replies
@GabrielHangor

Answer selected by GabrielHangor
@michaelcozzolino

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet