I'm using VueJs and I have this child component in my parent component. When the selection of the child component changes, I need to trigger a function in the parent component.
Subcomponent:
watch: { selectCoin() { this.$emit("currencyType", this.selectCoin["title"]); } }
The child component I use inside the parent component:
When the child component responds to the $emit of the parent component, I need to call this method:
methods :{ myFunction() { } }
I successfully accomplished this by adding a function in the "v-on" of @currencyType and passing it the value received from the child component as a parameter.