vue指令自定义

directives.js

import Vue from 'vue'

Vue.directive('test', {
    bind:function(el,binding,vnode){ },
    inserted:function(el,binding,vnode){ console.log(el, binding, vnode)},
    update:function(el,binding,vnode){ },
    componentUpdated:function(el,binding,vnode){ },
    unbind:function(el,binding,vnode){ },
})

你可能感兴趣的:(vue)