MCPcopy
hub / github.com/fanmingming/live / _createElement

Function _createElement

m3u8/vue.js:3362–3444  ·  view source on GitHub ↗
(
    context,
    tag,
    data,
    children,
    normalizationType
  )

Source from the content-addressed store, hash-verified

3360 }
3361
3362 function _createElement (
3363 context,
3364 tag,
3365 data,
3366 children,
3367 normalizationType
3368 ) {
3369 if (isDef(data) && isDef((data).__ob__)) {
3370 warn(
3371 "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
3372 'Always create fresh vnode data objects in each render!',
3373 context
3374 );
3375 return createEmptyVNode()
3376 }
3377 // object syntax in v-bind
3378 if (isDef(data) && isDef(data.is)) {
3379 tag = data.is;
3380 }
3381 if (!tag) {
3382 // in case of component :is set to falsy value
3383 return createEmptyVNode()
3384 }
3385 // warn against non-primitive key
3386 if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)
3387 ) {
3388 {
3389 warn(
3390 'Avoid using non-primitive value as key, ' +
3391 'use string/number value instead.',
3392 context
3393 );
3394 }
3395 }
3396 // support single function children as default scoped slot
3397 if (Array.isArray(children) &&
3398 typeof children[0] === 'function'
3399 ) {
3400 data = data || {};
3401 data.scopedSlots = { default: children[0] };
3402 children.length = 0;
3403 }
3404 if (normalizationType === ALWAYS_NORMALIZE) {
3405 children = normalizeChildren(children);
3406 } else if (normalizationType === SIMPLE_NORMALIZE) {
3407 children = simpleNormalizeChildren(children);
3408 }
3409 var vnode, ns;
3410 if (typeof tag === 'string') {
3411 var Ctor;
3412 ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
3413 if (config.isReservedTag(tag)) {
3414 // platform built-in elements
3415 vnode = new VNode(
3416 config.parsePlatformTagName(tag), data, children,
3417 undefined, undefined, context
3418 );
3419 } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {

Callers 1

createElementFunction · 0.85

Calls 10

isDefFunction · 0.85
warnFunction · 0.85
createEmptyVNodeFunction · 0.85
isPrimitiveFunction · 0.85
normalizeChildrenFunction · 0.85
simpleNormalizeChildrenFunction · 0.85
resolveAssetFunction · 0.85
createComponentFunction · 0.85
applyNSFunction · 0.85
registerDeepBindingsFunction · 0.85

Tested by

no test coverage detected