ant-design-vue/components/_util/antRefDirective.js
2018-12-13 22:47:23 +08:00

19 lines
488 B
JavaScript

export function antRef (Vue) {
return Vue.directive('ant-ref', {
bind: function (el, binding, vnode) {
binding.value(vnode.componentInstance ? vnode.componentInstance : vnode.elm)
},
update: function (el, binding, vnode) {
binding.value(vnode.componentInstance ? vnode.componentInstance : vnode.elm)
},
unbind: function (el, binding, vnode) {
binding.value(null)
},
})
}
export default {
install: (Vue, options) => {
antRef(Vue)
},
}