platforms 跨平台目录

  • web 面向浏览器
  • week 面向客户端使用 Web 开发语言,来构建 Android、iOS 和 Web 应用


runtime 提供不同入口文件

platforms/web/entry-runtime-with-compiler.js

带模版编译版本,直接在用于 script 引入

platforms/web/entry-runtime.js

不带模版编译,通过 webpack + Vue-loader 打包出来直接会转换成 render Funciton

挂载 API

src/platforms/web/runtime/index.js

Vue.prototype.$mount
Vue.prototype.patch

src/core/instance/state.js

Vue.prototype.$set
Vue.prototype.$delete
Vue.prototype.$watch

src/core/instance/events.js

Vue.prototype.$on
Vue.prototype.$once
Vue.prototype.$off
Vue.prototype.$emit

src/core/instance/lifecycle.js

Vue.prototype.$forceUpdate
Vue.prototype._update
Vue.prototype.$destroy

src/core/instance/render.js

Vue.prototype.$nextTick
Vue.prototype._render

运行流程

点击查看【processon】