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

Function _createElement

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

Source from the content-addressed store, hash-verified

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