前言
最近全面栽进vue源码解析中,将出一系列的学习笔记 以及个人的一些总结
mport { initMixin } from ‘./init‘ import { stateMixin } from ‘./state‘ import { renderMixin } from ‘./render‘ import { eventsMixin } from ‘./events‘ import { lifecycleMixin } from ‘./lifecycle‘ import { warn } from ‘../util/index‘ /*Github:https://github.com/answershuto*/ function Vue (options) { //vue 函数 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) //调用了这个函数 这个函数是定在原型上的 } initMixin(Vue) stateMixin(Vue) eventsMixin(Vue) lifecycleMixin(Vue) renderMixin(Vue) export default Vue
if (vm.$options.el) { /*挂载组件*/ vm.$mount(vm.$options.el) }
原文:https://www.cnblogs.com/ifannie/p/12334091.html