Skip to content

Is it okay to mutate a props if it's a Pinia state? #1556

Discussion options

You must be logged in to vote

no, you still shouldn't modify a prop because the idea behind a prop is that you don't know where it comes from. You either emit events and use v-model on the prop or use the store within the component and couple it to the store. Note the last version prevents you from using the component without the store and it's less flexible.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@zhao-li
Comment options

@posva
Comment options

@zhao-li
Comment options

Answer selected by zhao-li
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants