function Vue (options) {
if (!(thisinstanceof Vue)
) {
warn(‘Vue is a constructor and should be called with the `new` keyword‘);
}
this._init(options);
}
它实际上就是?个? Function 实现的类,我们只能通过new Vue 去实例化它。
Vue 按功能把这些扩展分散到多个模块中去实现,?不是在?个模块?实现所有,这种?式是? Class 难以实现的。这么做的好处是?常?便代码的维护和管理