sleepyShen1989 / blog

MIT License
0 stars 0 forks source link

【源码】Vue3源码阅读 #17

Open sleepyShen1989 opened 1 year ago

sleepyShen1989 commented 1 year ago

初次渲染流程

  1. createApp
  2. app.mount
  3. rerender->render
  4. patch
  5. processComponent
  6. mountComponent
  7. createComponentInstance
  8. setupComponent(instance)
  9. setupRenderEffect-> componentUpdateFn
    1. subtree
    2. patch
    3. processElement
    4. document.createElement
    5. mountChildren-> loop: patch(null, child)

createApp

runtime-dom中重写了app.mount,所以renderer.ts -> baseCreateRenderer中的createAppAPI返回的app的mount属性的container的类型HostElement不报错

组件VNode与组件Instance的区别