1. 程式人生 > >vue-cli3 的 [Vue warn]: You are using the runtime-only build of Vue where the template compiler 的問題解決

vue-cli3 的 [Vue warn]: You are using the runtime-only build of Vue where the template compiler 的問題解決

最近使用vue-cli3的腳手架生成專案,發現從配置完後vue-router的出現一個錯誤,

[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.

(found in <Root>)

圖片:
在這裡插入圖片描述

解決的辦法如下:
在根目錄下新建一個新的vue.config.js的檔案,

runtimeCompiler的介紹

module.exports = {
    runtimeCompiler: true
}

重新 yarn serve 啟動一下專案 報錯就GG了