Vue 定义
entry-runtime-with-compiler.js文件为入口runtime/index:在 Vue 原型上挂载了__patch__、$mount方法core/index:注册全局 api,Vue.prototype 添加$isServer,$ssrContext,FunctionalRenderContext属性instance/index:定义 Vue functioninitMixin方法定义Vue.prototype._init
Vue.prototype._init = function (options?: Object) {
const vm: Component = this;
vm._uid = uid++;
vm._isVue = true;
if (options && options._isComponent) {
initInternalComponent(vm, options);
} else {
vm.$options = mergeOptions(
resolveConstructorOptions(vm.constructor),
options || {},
vm
);
}
if (process.env.NODE_ENV !== "production") {
initProxy(vm);
} else {
vm._renderProxy = vm;
}
vm._self = vm;
initLifecycle(vm);
initEvents(vm);
initRender(vm);
callHook(vm, "beforeCreate");
initInjections(vm);
initState(vm);
initProvide(vm);
callHook(vm, "created");
if (vm.$options.el) {
vm.$mount(vm.$options.el);
}
};