MCPcopy Create free account
hub / github.com/TruthHun/BookStack / createFunctionalComponent

Function createFunctionalComponent

static/vuejs/vue.runtime.common.js:3055–3087  ·  view source on GitHub ↗
(
  Ctor,
  propsData,
  data,
  context,
  children
)

Source from the content-addressed store, hash-verified

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