Trying to utilize two instances of the same component, I have implemented two methods that should be triggered when one of the instances emits an event. The distinction between the two instances is that instance1 is supposed to call method1, while instance2 should call method2.
However, I am facing an issue where method1 is always being called, regardless of which component triggers the event. Am I overlooking something?
Below is a brief example of my setup:
CustomComponent
<template>
....// Some code that calls myMethod at a certain point
</template>
<script>
export default {
methods: {
myMethod () {
this.$emit('picture-taken')
}
}
}
</script>
Page where CustomComponent is used
<template>
<custom-component @picture-taken="func1" />
<custom-component @picture-taken="func2" />
</template>
<script>
export default {
methods: {
func1() {
debugger
// This function always ends up getting executed
},
func2() {
debugger
},
}
}
</script>