1👍
✅
It is better to pass the value of the prop
to data
items like this:
data(){
return{
form{
id:null,
birthplace:null
}
}
},
props:['user'],
created(){
if(this.user){
this.form.id = this.user.id;
if(this.user.profile)
this.form.birthplace = this.user.profile.birthplace,
}
}
Source:stackexchange.com