日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > vue >内容正文

vue

[Vue warn]: You are using the runtime-only build of Vue 牵扯到Vue runtime-compiler与runtime-only区别

發布時間:2023/12/13 vue 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 [Vue warn]: You are using the runtime-only build of Vue 牵扯到Vue runtime-compiler与runtime-only区别 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

[Vue warn]:?You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.

1. Vue的編譯渲染過程

template --> ast --> render函數 --> VDom --> 真實DOM

  • 先將template解析(parse)成抽象語法樹(ast)
  • 將ast編譯(compiler)成render函數
  • 將render函數渲染(render)成虛擬DOM
  • 最后將虛擬DOM渲染成真實DOM

(1) runtime-compiler的步驟
template --> ast --> render函數 --> VDom --> 真實DOM

(2) runtime-only的步驟
render函數 --> VDom --> 真實DOM

vue中兩者的切換

/* 帶webpack顯性配置的 */ //webpack.config.js //其實就是取別名,找到以 vue 結尾的,就去node_modules重新查一下路徑 module.exports = {resolve: {alias: {'vue$': 'vue/dist/vue.esm.js' // 用 webpack 1 時需用 'vue/dist/vue.common.js'}} }/* webpack隱性配置的 */ //vue.config.js //true 就是完整版的(即runtime-compiler) module.exports = {runtimeCompiler: true //ture: runtime-compiler false: runtime-only }

總結

以上是生活随笔為你收集整理的[Vue warn]: You are using the runtime-only build of Vue 牵扯到Vue runtime-compiler与runtime-only区别的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。