So here's the scenario:
HTML:
<div id="app">
<div v-sample:callback="greet"></div>
</div>
<script>
var app = new Vue({
el: "#app",
data: {
files: [],
},
methods: {
greet: function (arg) {
alert(arg);
},
},
});
</script>
JS:
Vue.directive('sample', {
bind: function (el, binding, vnode) {
el.addEventListener('...', function () {
// ...
callback.call(arg, ...);
});
},
});
But I'm stuck on how to properly access and evaluate the function. What is the correct syntax for doing this within a directive?