vue-cli3 的 [Vue warn]: You are using the runtime-only build of Vue where the template compiler 的问题解决

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Zhooson/article/details/83716146

最近使用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了

猜你喜欢

转载自blog.csdn.net/Zhooson/article/details/83716146