三十四、runtime-compiler 和 runtime-only 的区别

一、Vue程序的运行过程:

二、runtime-compiler 和 runtime-only的区别

1.程序运行流程如下所示(左侧为:runtime-compiler;右侧为:runtime-only )

 

 

 区别:

  • runtime-only的性能更高
  • runtime-only的代码量较少,runtime-compiler 会对 templare -> ast -> render 进行处理,所以在创建项目时,runtime-only会轻6kb
  • runtime-only中的 template 会由 vue-template-compiler 进行处理,最后得到一个 render 然后直接往后继续执行渲染

 

 

posted @ 2022-04-14 15:38  搬砖工具人  阅读(196)  评论(0编辑  收藏  举报