ant-design-vue/components/_util/createRefHooks.js
2020-06-11 16:13:09 +08:00

15 lines
318 B
JavaScript

const createRef = fn => {
return {
onVnodeBeforeMount: vnode => {
fn(vnode.component || vnode.el, vnode.key);
},
onVnodeUpdated: vnode => {
fn(vnode.component || vnode.el, vnode.key);
},
onVnodeUnmounted: vnode => {
fn(null, vnode.key);
},
};
};
export default createRef;