vue.js 源代码学习笔记 ----- instance index

vue

import { initMixin } from './init'

import { stateMixin } from './state'

import { renderMixin } from './render'

import { eventsMixin } from './events'

import { lifecycleMixin } from './lifecycle'

import { warn } from '../util/index'

function Vue (options) {

if (process.env.NODE_ENV !== 'production' &&

!(this instanceof Vue)) {
//提示需要 new 实例化

warn('Vue is a constructor and should be called with the `new` keyword')

}

this._init(options)

}


//扩展vue的原型方法

initMixin(Vue)

stateMixin(Vue)

eventsMixin(Vue)

lifecycleMixin(Vue)

renderMixin(Vue)

export default Vue

以上是 vue.js 源代码学习笔记 ----- instance index 的全部内容, 来源链接: utcz.com/z/378704.html

回到顶部