I want to bind custom event on root tag instead of binding it in mounted(). So I try the following code:
render (h) {
return (
<div on-custom-event={this.handleCustomEvent}></div>
)
}
But when I run it with Chrome, I found that custom-event was bound to DOM which cannot be fired using $emit, but with VueJS 2's template syntax it is easy to do:
<template>
<div @custom-event="handleCustomEvent"></div>
</template>
Please help me on this problem, thanks!