MCPcopy
hub / github.com/fanmingming/live / cloneVNode

Function cloneVNode

m3u8/vue.js:828–852  ·  view source on GitHub ↗
(vnode)

Source from the content-addressed store, hash-verified

826 // multiple renders, cloning them avoids errors when DOM manipulations rely
827 // on their elm reference.
828 function cloneVNode (vnode) {
829 var cloned = new VNode(
830 vnode.tag,
831 vnode.data,
832 // #7975
833 // clone children array to avoid mutating original in case of cloning
834 // a child.
835 vnode.children && vnode.children.slice(),
836 vnode.text,
837 vnode.elm,
838 vnode.context,
839 vnode.componentOptions,
840 vnode.asyncFactory
841 );
842 cloned.ns = vnode.ns;
843 cloned.isStatic = vnode.isStatic;
844 cloned.key = vnode.key;
845 cloned.isComment = vnode.isComment;
846 cloned.fnContext = vnode.fnContext;
847 cloned.fnOptions = vnode.fnOptions;
848 cloned.fnScopeId = vnode.fnScopeId;
849 cloned.asyncMeta = vnode.asyncMeta;
850 cloned.isCloned = true;
851 return cloned
852 }
853
854 /*
855 * not type checking this file because flow doesn't play well with

Callers 3

createElmFunction · 0.85
patchVnodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected