# 文件浅析对照
# 目录结构
benchmarks
性能、基准测试dist
打包输出flow
flow 语法类型声明 理解为约束接口吧哈哈packages
一些额外的包scripts
构建源码的文件夹build.js
构建入口
src
源码开始core
你要学的都在里面啦platforms
构建后不同平台的入口server
服务器渲染相关
compiler
编译器test
types
ts类型声明 对应一下flow
# core核心
config.js
默认配置index.js
入口components
全局组件 keep-alivegloble-api
全局apiassets.js
'component','directive','filter'extend.js
靠创建子类构造器Sub.prototype - mergeOptions - Sub.extend = Super.extendindex.js
入口 你会看到很多initmixin.js
mergeOptionsuse.js
Vue.use = function (plugin: Function | Object){ 用apply }
instacne
vue实例开始render-helpers
events.js
vm._events是在实例上的,暴露给外面 $on $off $emitindex.js
入口 并且你会看到很多定义在原型上的mixininit.js
this._init(option) vm->/生命周期/events/响应式/provideinject.js
initProvide & initInjectionslifecycle.js
$parent/$children/$refs $forceUpdate(利用$watcher)proxy.js
响应式(仅仅init拦截)拦截 vm._renderProxy = new Proxy(vm, handlers)// 代理vm实例到vm属性render.js
$slots createElement vnodestate.js
响应式!connect observe&watch
observer
响应式原理util
工具方法debug.js
env.js
error.js
index.js
lang.js
next-tick.js
option.js
关于合并选项的规则perf.js
props.js
vdom
虚拟dom和渲染和patch相关