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

Function _createElement

static/vuejs/vue.runtime.common.js:3284–3347  ·  view source on GitHub ↗
(
  context,
  tag,
  data,
  children,
  normalizationType
)

Source from the content-addressed store, hash-verified

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