Vuetify Component Communication Problem (Props / Events - Parent Child Communication)
Hi, I try to pass data between parent and child like this tutorial: https://www.youtube.com/watch?v=PPmg7ntQjzc
Regular HTML input works fine (just like in the tutorial).
But vuetify text field or text area don't work. (it seems fine at first. when I start type, it gives error)
What am I doing wrong?
// Child HTML
<input
type="text"
placeholder="regular child"
:value="valueRegularChild"
@input="inputRegularChild"
>
<p>{{ regularInputValue }}</p>
<v-textarea
type="text"
placeholder="vuetify child"
:value="valueVuetifyChild"
@input="inputVuetifyChild"
></v-textarea>
<p>{{ vuetifyInputValue }}</p>
// Child - methods
inputVuetifyChild($event) {
this.vuetifyInputValue = $event.target.value;
this.$emit('msgVuetify', this.vuetifyInputValue);
},
inputRegularChild($event) {
this.regularInputValue = $event.target.value;
this.$emit('msgRegular', this.regularInputValue);
},
// parent HTML
<child-component
:valueVuetifyChild="insideParentVuetify"
:valueRegularChild="insideParentRegular"
@msgVuetify="insideParentVuetify = $event"
@msgRegular="insideParentRegular = $event"
>
<child-component>
everything same.
Regular works, Vuetify don't
consol log error says:
TypeError: Cannot read property 'value' of undefined
thanks in advance
:input-value="valueVuetifyChild"instead of:valuemaybe? Or just$eventinstead of$event.target.value. Vuetify uses different props and events sometimes than native components. - TraxoinputRegularChild($event) {console.log($event)}and see what you can use in there. - Andrew1325$eventinstead of$event.target.valueworks perfect. Thanks. It also work with select menu. however,it don't work with checkbox or radios. Can you suggest something for them also? - Uzun_Ihsan