tap.js
321 Bytes
const bingFn = (fn) => {
return function(evt) {
fn(evt);
evt.preventDefault();
evt.stopPropagation();
};
};
export default {
bind(el, binding) {
el.addEventListener('e-click', bingFn(binding.value));
},
unbind(el, binding) {
el.removeEventListener('e-click', bingFn(binding.value));
}
};