How can I define a local method inside my directive and utilize it within the bind and componentUpdated functions? Below is the code snippet in question:
export const OutsideClick = {
bind (el, binding, vnode) {
console.log(new Vue());
// call method1()
},
componentUpdated(el, binding, vnode) {
console.log('updated comp', binding);
if(binding.value[1]()) {
// call method1();
}
},
unbind(el, binding, vnode) {
console.log('unbinding');
}
}
I am looking for a way to create a function inside this Directive that can be accessed by both the bind and componentUpdated methods.