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