VueJS Custom Directive Function as Argument
You can use binding.value
which should be a function in this case. It's already prebound to correct context so just call it (pass anything in it if you need something):
Vue.directive('sample', { bind: function (el, binding, vnode) { el.addEventListener('click', function () { binding.value() }); },});
Maybe you can do like this.
<div v-mydirect:fn="params"></div>Vue.directive('mydirect', { bind (el, binding,vnode) { let that = vnode.context that[binding.arg](binding.value) }})