I have an HTML partial like:
<div v-on:customevent="test">
<button @click="launchEvent">TestEvent</button>
</div>
In my component I have this:
methods:{
launchEvent(){
this.$emit('customevent');
},
test(){
console.log("I'm in");
}
}
But even tt runs correctly function launchEvent it doesn't launch function test as the event was not caught because the event is correctly launched because if I try set in created():
this.$on('customevent',function(){
alert("customevent launched");
});
The alert is correctly launched, so, Is it possible listen custom event directly on HTML?