[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 牵扯到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区别的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: .slice(0)
- 下一篇: React AntD 表格查看修改时默认