I am new in Vue, and I have component (id="apartments"), in which I am getting content from another resources/views file, the code which I have used for adding html is:
plansHtml = '<a href="{{ $plans[0]['href'] }}" v-on:click="testfunction();"></a>';//This is the html which I am getting from Ajax, and in this html I have used v-on:click
activePlanContainer.html(plansHtml);
And the code in my Js file is:
var appApartments = new Vue({
el: '#apartments',
methods: {
testfunction: function() {
console.log('Test function called');
}
}
});
Please let me know what I am doing wrong, I have also tried v-on:click-native="testfunction();" but this also didn't worked. Thanks in advance