vue vue-cli3 注册 compent 报错 # 报错内容 >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. >当前使用的运行时版本 Vue 不包含模板编译器。考虑通过 render 函数编译模板,或使用包含编译器的版本。 在使用vue-cli 3创建一个项目后,使用Vue.compent创建组建时报告了上面的错误,错误原因如中文译文所示。 # 解决方案 参考了vue-cli官网的 [配置内容](https://cli.vuejs.org/zh/config/#runtimecompiler "配置内容")。在与package.json同级的文件夹创建一个vue.config.js的配置文件。 添加以下代码: ``` module.exports = { runtimeCompiler: true } ``` 重新运行 `npm run serve`即可。 阅读全文 2020-03-17 dogify 0 条评论 3702 次浏览