I've a Vue.js instance as follows:
new Vue({
el: '#app',
data: {
active: ''
}
methods: {
addActive: function(){
$(document).on('click', '[prop-name]', function(){
this.active = {name: $('this').attr('prop-name'), latitude: $('this').attr('prop-lat'), longitude: $('this').attr('prop-long'), icon: $('this').attr('prop-icon')};
}.bind(this));
}
}
});
I want to set the data active when I trigger the addActive method. But I think I'm unable to set the active like I'm doing it here. How can I do this?