ant-design-vue/components/_util/createRefHooks.js

15 lines
318 B
JavaScript
Raw Normal View History

2020-06-10 10:21:16 +00:00
const createRef = fn => {
return {
2020-06-11 08:13:09 +00:00
onVnodeBeforeMount: vnode => {
2020-06-10 10:21:16 +00:00
fn(vnode.component || vnode.el, vnode.key);
},
onVnodeUpdated: vnode => {
fn(vnode.component || vnode.el, vnode.key);
},
2020-06-11 08:13:09 +00:00
onVnodeUnmounted: vnode => {
fn(null, vnode.key);
2020-06-10 10:21:16 +00:00
},
};
};
export default createRef;