[Vuejs]-Pass data from child input element to parent in vue

0👍

you have to specify a emits option in the child component
docs

so in your case should look like this

export default {
emits: ['transmit-data'], // you need to add this :)
data() {
    return { userinput: " dd" }
},
methods: {
    transmitData(event){
        this.$emit('transmit-data', this.userinput)
    }
}
}

Leave a comment