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

Function _createElement

static/vuejs/vue.esm.js:3286–3349  ·  view source on GitHub ↗
(
  context,
  tag,
  data,
  children,
  normalizationType
)

Source from the content-addressed store, hash-verified

3284}
3285
3286function _createElement (
3287 context,
3288 tag,
3289 data,
3290 children,
3291 normalizationType
3292) {
3293 if (data && data.__ob__) {
3294 process.env.NODE_ENV !== 'production' && warn(
3295 "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
3296 'Always create fresh vnode data objects in each render!',
3297 context
3298 );
3299 return createEmptyVNode()
3300 }
3301 if (!tag) {
3302 // in case of component :is set to falsy value
3303 return createEmptyVNode()
3304 }
3305 // support single function children as default scoped slot
3306 if (Array.isArray(children) &&
3307 typeof children[0] === 'function') {
3308 data = data || {};
3309 data.scopedSlots = { default: children[0] };
3310 children.length = 0;
3311 }
3312 if (normalizationType === ALWAYS_NORMALIZE) {
3313 children = normalizeChildren(children);
3314 } else if (normalizationType === SIMPLE_NORMALIZE) {
3315 children = simpleNormalizeChildren(children);
3316 }
3317 var vnode, ns;
3318 if (typeof tag === 'string') {
3319 var Ctor;
3320 ns = config.getTagNamespace(tag);
3321 if (config.isReservedTag(tag)) {
3322 // platform built-in elements
3323 vnode = new VNode(
3324 config.parsePlatformTagName(tag), data, children,
3325 undefined, undefined, context
3326 );
3327 } else if ((Ctor = resolveAsset(context.$options, 'components', tag))) {
3328 // component
3329 vnode = createComponent(Ctor, data, context, children, tag);
3330 } else {
3331 // unknown or unlisted namespaced elements
3332 // check at runtime because it may get assigned a namespace when its
3333 // parent normalizes children
3334 vnode = new VNode(
3335 tag, data, children,
3336 undefined, undefined, context
3337 );
3338 }
3339 } else {
3340 // direct component options / constructor
3341 vnode = createComponent(tag, data, context, children);
3342 }
3343 if (vnode) {

Callers 1

createElementFunction · 0.70

Calls 7

createEmptyVNodeFunction · 0.70
normalizeChildrenFunction · 0.70
simpleNormalizeChildrenFunction · 0.70
resolveAssetFunction · 0.70
createComponentFunction · 0.70
applyNSFunction · 0.70
warnFunction · 0.50

Tested by

no test coverage detected