【发布时间】:2020-10-22 21:27:39
【问题描述】:
我正在尝试使用 $emit 将数据从子组件传递到父组件,但它不起作用。
这就是我正在做的:
// child component
<v-text-field
@change="function"
v-model="choice1"
label="Choice 1"
></v-text-field>
// Script
metods:{
function(event) {
this.$emit('input', this.choice1); // I tried 'change' at the place of 'input' but with no result too.
},
}
// parent component
<typeQst @change="getRep"></typeQst> // my child component
//script
getRep(value){
console.log(value);
}
【问题讨论】:
标签: vue.js vuetify.js