MCPcopy Create free account
hub / github.com/TruthHun/BookStack / createElm

Function createElm

static/vuejs/vue.common.js:4597–4649  ·  view source on GitHub ↗
(vnode, insertedVnodeQueue, parentElm, refElm, nested)

Source from the content-addressed store, hash-verified

4595
4596 var inPre = 0;
4597 function createElm (vnode, insertedVnodeQueue, parentElm, refElm, nested) {
4598 vnode.isRootInsert = !nested; // for transition enter check
4599 if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
4600 return
4601 }
4602
4603 var data = vnode.data;
4604 var children = vnode.children;
4605 var tag = vnode.tag;
4606 if (isDef(tag)) {
4607 if (process.env.NODE_ENV !== 'production') {
4608 if (data && data.pre) {
4609 inPre++;
4610 }
4611 if (
4612 !inPre &&
4613 !vnode.ns &&
4614 !(config.ignoredElements.length && config.ignoredElements.indexOf(tag) > -1) &&
4615 config.isUnknownElement(tag)
4616 ) {
4617 warn(
4618 'Unknown custom element: <' + tag + '> - did you ' +
4619 'register the component correctly? For recursive components, ' +
4620 'make sure to provide the "name" option.',
4621 vnode.context
4622 );
4623 }
4624 }
4625 vnode.elm = vnode.ns
4626 ? nodeOps.createElementNS(vnode.ns, tag)
4627 : nodeOps.createElement(tag, vnode);
4628 setScope(vnode);
4629
4630 /* istanbul ignore if */
4631 {
4632 createChildren(vnode, children, insertedVnodeQueue);
4633 if (isDef(data)) {
4634 invokeCreateHooks(vnode, insertedVnodeQueue);
4635 }
4636 insert(parentElm, vnode.elm, refElm);
4637 }
4638
4639 if (process.env.NODE_ENV !== 'production' && data && data.pre) {
4640 inPre--;
4641 }
4642 } else if (isTrue(vnode.isComment)) {
4643 vnode.elm = nodeOps.createComment(vnode.text);
4644 insert(parentElm, vnode.elm, refElm);
4645 } else {
4646 vnode.elm = nodeOps.createTextNode(vnode.text);
4647 insert(parentElm, vnode.elm, refElm);
4648 }
4649 }
4650
4651 function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
4652 var i = vnode.data;

Callers 4

createChildrenFunction · 0.70
addVnodesFunction · 0.70
updateChildrenFunction · 0.70
createPatchFunctionFunction · 0.70

Calls 8

createComponentFunction · 0.70
isDefFunction · 0.70
setScopeFunction · 0.70
createChildrenFunction · 0.70
invokeCreateHooksFunction · 0.70
insertFunction · 0.70
isTrueFunction · 0.70
warnFunction · 0.50

Tested by

no test coverage detected