Vue.js 技术揭秘(学习) vue流程

new Vue()

  _init()

    mergeOptions

   

$watch --> new Watch

   

vm._render  生成VNode

  create diff patch

vm._update  渲染VNode

  createElm

vue组件更新

  数据变化时,触发 渲染watcher的回调函数,进而执行组件的更新过程

  new Watcher 

  updateComponent

    vm._update  vm._render()--> vnode

      vm.__patch__

  新旧节点不同

   创建新节点--> 更新占位符节点 --> 删除纠结点 

      

 编译

  runtime+ compile

    Vue.prototype.$mount(没有render时重写)

      

原文地址:https://www.cnblogs.com/wenhandi/p/9647166.html