3π
β
Itβs because the scope of openSMS()
is not the same as the click
handler function. Assuming you can change the method signature, modify openSMS()
to accept the element reference as an argument:
methods: {
openSMS(el) {
$(el).hide();
},
addEventListeners() {
$(document).ready(function() {
$(".ml-inbox-msg-item").click(function() {
InboxSidebar.openSMS(this);
});
});
}
}
Source:stackexchange.com