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