I have a problem making the parent binding update from changes in the child.
I have the following vue code:
Vue.component('usercomp', {
template: '<input v-model="user.name.lastname">',
props:['user'],
computed: {
fullname: function() {
return this.user.firstname + ' ' + this.user.lastname;
}
}
});
new Vue({
el: '#user-example',
data: function() {
return {
user: {
name: {
fullname: '',
firstname: '',
lastname: '',
}
}
}
}
})
where I am binding the computed property of the child on the parents view.
I'm trying to get a computed property from the child to update a <p>
in the parent.
I've tried using a store, but seems to give the exact same result unfortunately.
I have created this fiddle: https://jsfiddle.net/alexintime/02jxvqex/7/