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

Function createFunctionalComponent

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

Source from the content-addressed store, hash-verified

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