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

Function createComponent

static/vuejs/vue.runtime.esm.js:2968–3051  ·  view source on GitHub ↗
(
  Ctor,
  data,
  context,
  children,
  tag
)

Source from the content-addressed store, hash-verified

2966var hooksToMerge = Object.keys(componentVNodeHooks);
2967
2968function createComponent (
2969 Ctor,
2970 data,
2971 context,
2972 children,
2973 tag
2974) {
2975 if (!Ctor) {
2976 return
2977 }
2978
2979 var baseCtor = context.$options._base;
2980 if (isObject(Ctor)) {
2981 Ctor = baseCtor.extend(Ctor);
2982 }
2983
2984 if (typeof Ctor !== 'function') {
2985 if (process.env.NODE_ENV !== 'production') {
2986 warn(("Invalid Component definition: " + (String(Ctor))), context);
2987 }
2988 return
2989 }
2990
2991 // async component
2992 if (!Ctor.cid) {
2993 if (Ctor.resolved) {
2994 Ctor = Ctor.resolved;
2995 } else {
2996 Ctor = resolveAsyncComponent(Ctor, baseCtor, function () {
2997 // it's ok to queue this on every render because
2998 // $forceUpdate is buffered by the scheduler.
2999 context.$forceUpdate();
3000 });
3001 if (!Ctor) {
3002 // return nothing if this is indeed an async component
3003 // wait for the callback to trigger parent update.
3004 return
3005 }
3006 }
3007 }
3008
3009 // resolve constructor options in case global mixins are applied after
3010 // component constructor creation
3011 resolveConstructorOptions(Ctor);
3012
3013 data = data || {};
3014
3015 // transform component v-model data into props & events
3016 if (data.model) {
3017 transformModel(Ctor.options, data);
3018 }
3019
3020 // extract props
3021 var propsData = extractProps(data, Ctor, tag);
3022
3023 // functional component
3024 if (Ctor.options.functional) {
3025 return createFunctionalComponent(Ctor, propsData, data, context, children)

Callers 2

_createElementFunction · 0.70
createElmFunction · 0.70

Calls 14

extendMethod · 0.80
isObjectFunction · 0.70
resolveAsyncComponentFunction · 0.70
transformModelFunction · 0.70
extractPropsFunction · 0.70
mergeHooksFunction · 0.70
isDefFunction · 0.70
iFunction · 0.70
initComponentFunction · 0.70
isTrueFunction · 0.70

Tested by

no test coverage detected