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

Function createFunctionalComponent

static/vuejs/vue.runtime.esm.js:3053–3085  ·  view source on GitHub ↗
(
  Ctor,
  propsData,
  data,
  context,
  children
)

Source from the content-addressed store, hash-verified

3051}
3052
3053function createFunctionalComponent (
3054 Ctor,
3055 propsData,
3056 data,
3057 context,
3058 children
3059) {
3060 var props = {};
3061 var propOptions = Ctor.options.props;
3062 if (propOptions) {
3063 for (var key in propOptions) {
3064 props[key] = validateProp(key, propOptions, propsData);
3065 }
3066 }
3067 // ensure the createElement function in functional components
3068 // gets a unique context - this is necessary for correct named slot check
3069 var _context = Object.create(context);
3070 var h = function (a, b, c, d) { return createElement(_context, a, b, c, d, true); };
3071 var vnode = Ctor.options.render.call(null, h, {
3072 props: props,
3073 data: data,
3074 parent: context,
3075 children: children,
3076 slots: function () { return resolveSlots(children, context); }
3077 });
3078 if (vnode instanceof VNode) {
3079 vnode.functionalContext = context;
3080 if (data.slot) {
3081 (vnode.data || (vnode.data = {})).slot = data.slot;
3082 }
3083 }
3084 return vnode
3085}
3086
3087function createComponentInstanceForVnode (
3088 vnode, // we know it's MountedComponentVNode but flow doesn't

Callers 1

createComponentFunction · 0.70

Calls 2

validatePropFunction · 0.70
resolveSlotsFunction · 0.70

Tested by

no test coverage detected