// Vue 2.0.0 src/core/instance/init.js
export function initMixin(Vue: Class<Component>) {
Vue.prototype._init = function (options?: Object) {
if (options && options._isComponent) {
// optimize internal component instantiation
// since dynamic options merging is pretty slow, and none of the
// internal component options needs special treatment.
initInternalComponent(vm, options)
}
else {
vm.$options = mergeOptions(
resolveConstructorOptions(vm),
options || {},
vm
)
}
注释中说,动态选项合并很慢,而且内部组件的选项不需要特殊对待,所以使用了initInternalComponent简单处理下,有2个问题
(1)内部组件的选项不需要特殊对待,为何?
(2)动态选项合并很慢,应该是指mergeOptions的操作很耗时,看了下里边的逻辑,并没有觉得哪里很耗时?