I'm trying to define a directive and I need to be executed right when DOM is rendered.
I was reading about different hooks, but inserted () or update () hook doesnt do the trick. This is my directive:
Vue.directive('validation-directive', {
bind (el, binding, vNode) {
addValidation(el, binding)
},
inserted (el, binding, vNode) {
addValidation(el, binding)
},
stopProp (event) { event.stopPropagation() }
})
function addValidation (el, binding) {
console.log(el)
}
Anyone knows how to do it? Thanks!