( Ctor, data, context, children, tag )
| 2966 | var hooksToMerge = Object.keys(componentVNodeHooks); |
| 2967 | |
| 2968 | function 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) |
no test coverage detected