You are using the runtime-only build of Vue where the template c
F12控制臺報錯信息:
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.
報錯截圖:

原因簡述:
在項目配置的時候,默認 npm 包導出的是運行時構建,即 runtime 版本,不支持編譯 template 模板。意思是說,你使用的是僅運行時的版本的模板。。。
【1】最簡單解決方法:
在項目根目錄添加:vue.config.js文件,
內容為:
【2】把main.js中的代碼改成這樣:
//----------------
版本:vue2、@vue/cli 4.5.13、node v16.13.0、npm 7.20.6、win10
擴展資料:百度查控制臺的報錯信息英文提示,有一堆。。。
標簽: