Vue
HTML
<div id="app" @click="click">
<div v-html="html"></div>
</div>
CSS
a {
text-decoration: underline;
cursor: pointer;
}
Vue
new Vue({
el: "#app",
data: {
html: `hello <a @click="hello">click me</a>`,
},
methods: {
click: function(e) {
const fn = e.target.getAttribute('@click');
console.log('click', fn);
this[fn]();
},
hello: function(todo){
console.log('hello')
},
}
})