vue开始的地方

75 阅读1分钟

文件目录:code/instance/index.js

function Vue (options) {  
    if (process.env.NODE_ENV !== 'production' &&    
        !(this instanceof Vue)) {        
        warn('Vue is a constructor and should be called with the `new` keyword')  
    }  
    /*初始化*/  
    this._init(options)
}

就是一个 function 方法

initMixin(Vue)stateMixin(Vue)eventsMixin(Vue)lifecycleMixin(Vue)renderMixin(Vue)

之后调用了五个方法来初始化vue。