21
rated 0 times
[
25]
[
4]
/ answers: 1 / hits: 21831
/ 6 Years ago, tue, september 18, 2018, 12:00:00
I am not able to $emit
an event from a child component to it's parent.
I can successfully send the event, but not receive it in the parent.
Results.vue
(Child):
<a href=# v-on:click=sendResultValues></a>
//
methods: {
sendResultValues: function () {
this.$emit('send-result-values', 'carrier');
}
},
When I click on the <a>
, I can see with Vue DevTools that an $emit
event is fired:
However, nothing is received in the console.log as my code below (parent):
Input.vue
(Parent):
<search-results></search-results> //Results.vue component
<search-popover v-on:send-result-values=showResultData></search-popover>
//
methods: {
showResultData: function () {
console.log(Data received from child: )
}
},
More From » vue.js