(
Ctor,
data,
context,
children,
tag
)
| 3173 | var hooksToMerge = Object.keys(componentVNodeHooks); |
| 3174 | |
| 3175 | function createComponent ( |
| 3176 | Ctor, |
| 3177 | data, |
| 3178 | context, |
| 3179 | children, |
| 3180 | tag |
| 3181 | ) { |
| 3182 | if (isUndef(Ctor)) { |
| 3183 | return |
| 3184 | } |
| 3185 | |
| 3186 | var baseCtor = context.$options._base; |
| 3187 | |
| 3188 | // plain options object: turn it into a constructor |
| 3189 | if (isObject(Ctor)) { |
| 3190 | Ctor = baseCtor.extend(Ctor); |
| 3191 | } |
| 3192 | |
| 3193 | // if at this stage it's not a constructor or an async component factory, |
| 3194 | // reject. |
| 3195 | if (typeof Ctor !== 'function') { |
| 3196 | { |
| 3197 | warn(("Invalid Component definition: " + (String(Ctor))), context); |
| 3198 | } |
| 3199 | return |
| 3200 | } |
| 3201 | |
| 3202 | // async component |
| 3203 | var asyncFactory; |
| 3204 | if (isUndef(Ctor.cid)) { |
| 3205 | asyncFactory = Ctor; |
| 3206 | Ctor = resolveAsyncComponent(asyncFactory, baseCtor); |
| 3207 | if (Ctor === undefined) { |
| 3208 | // return a placeholder node for async component, which is rendered |
| 3209 | // as a comment node but preserves all the raw information for the node. |
| 3210 | // the information will be used for async server-rendering and hydration. |
| 3211 | return createAsyncPlaceholder( |
| 3212 | asyncFactory, |
| 3213 | data, |
| 3214 | context, |
| 3215 | children, |
| 3216 | tag |
| 3217 | ) |
| 3218 | } |
| 3219 | } |
| 3220 | |
| 3221 | data = data || {}; |
| 3222 | |
| 3223 | // resolve constructor options in case global mixins are applied after |
| 3224 | // component constructor creation |
| 3225 | resolveConstructorOptions(Ctor); |
| 3226 | |
| 3227 | // transform component v-model data into props & events |
| 3228 | if (isDef(data.model)) { |
| 3229 | transformModel(Ctor.options, data); |
| 3230 | } |
| 3231 | |
| 3232 | // extract props |
no test coverage detected