I initialize state in my vue 3 component as follows:
data() {
return {
new_listing: this.listing //which is a prop
}
}
However when I bind it to an input for example:
<input type="text" placeholder="title" v-model="new_listing.title" />
the expected result is for only new_listing.title
to change, however the prop listing
also seems to change. How do I make it so that only the state new_listing.title
changes and not the prop listing.title
.