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

Function createElm

static/vuejs/vue.esm.js:4595–4647  ·  view source on GitHub ↗
(vnode, insertedVnodeQueue, parentElm, refElm, nested)

Source from the content-addressed store, hash-verified

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