源碼中vue入口
function Vue (options) { if (!(this instanceof Vue) ) { warn('Vue is a constructor and should be called with the `new` keyword'); } this._init(options); }
它實際上就是⼀個⽤ Function 實現的類,我們只能通過new Vue 去實例化它。
Vue 按功能把這些擴展分散到多個模塊中去實現,⽽不是在⼀個模塊⾥實現所有,這種⽅式是⽤ Class 難以實現的。這么做的好處是⾮常⽅便代碼的維護和管理