Can anyone suggest how to make an appended dynamic element clickable on VueJS?
The tooltip button is not triggering the vuejs popAlert methods.
const myVue = new Vue({
el: '#vue',
methods: {
popAlert: function() {
alert('clicked');
}
}
});
$(function() {
$('#calendar').fullCalendar({
defaultDate: '2017-10-12',
editable: true,
eventLimit: true, // allow "more" link when too many events
events: [
{
title: 'All Day Event',
start: '2017-10-01'
},
{
title: 'Long Event',
start: '2017-10-07',
end: '2017-10-10'
},
{
id: 999,
title: 'Repeating Event',
start: '2017-10-09T16:00:00'
},
],
eventRender: function(event, element, view) {
let htmlText = `<div class="ui tooltip">
<h3>Tooltip title</h3>
<button type="button" class="ui mini button" @click="popAlert">Delete</button>
</div>`;
$(element).popup({
inline: false,
on: 'click',
exclusive: true,
hoverable: true,
html: htmlText,
context: '#vue',
});
}
});
});
popupsemantic-ui tooltip "delete" button is calling thepopAlertmethod