MCPcopy Index your code
hub / github.com/TruthHun/BookStack / _createElement

Function _createElement

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

Source from the content-addressed store, hash-verified

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