I have a custom component <item> which looks like this:
item.vue
<script>
export default {
render: function (c) {
var self = this;
const contentEl = c('div', {staticClass:'item-content', domProps: {innerHTML: self.content}});
return c('div', {
staticClass: 'item',
class: {
'item-left': self.side === 'left',
'item-right': self.side === 'right'
}
}, [contentEl])
},
props: {
content: String,
}
}
</script>
It can be used like this:
<item :content="Hello world"></item>
This will print "Hello world" and works fine but now I want the item to be clickable like this:
<item v-on:click="myClickEvent" :content="Hello world"></item>
Question:
How can I make the <item> component to fire a click event when its inner <div> was clicked?