runtimecompiler 和 runtimeonly是什么

大纲

1.runtimecompiler 和 runtimeonly是什么
2.runtimeonly优点

1. runtimecompiler 和 runtimeonly 是什么?

runtimecompiler
模板渲染DOM模式:template -> ast -> render -> vdom -> UI

new Vue({
  el:'#app',
  components:{App},
  template:'<App/>',
})

runtimeonly
模板渲染DOM模式:render -> vdom -> UI

new Vue({
  el:'#app',
  render:h=>h(App)
})

2.runtimeonly优点

runtimeonly优点:性能更高,代码量更少

posted @ 2022-12-06 22:17  轻风细雨_林木木  阅读(35)  评论(0编辑  收藏  举报