0👍
I managed to fix my issue by cloning the user object after opening the modal.
<b-button variant="info" @click="editUser(user)">Edit</b-button>
[...]
export default {
props: {
user: Object
},
data() {
return {
modalShow: false,
editedUser: {},
}
},
methods: {
editUser(user) {
this.modalShow = true
this.editedUser = JSON.parse(JSON.stringify(user));
}
onSubmit(evt) {
[...]
}
}
}
However, I still don’t understand why the previous piece of code doesn’t have the same behavior.
- [Vuejs]-How to initialize a data property to a prop object property in Vue JS
- [Vuejs]-Vue.js routes send to 404 on refresh
Source:stackexchange.com