学无先后,达者为师

网站首页 Vue 正文

VUE报错You are using the runtime-only build of Vue where the template compiler is not available

作者:无敌的黑星星 更新时间: 2022-03-01 Vue

问题背景
今天在入门vue-route但是发现怎么处理都有以下报错,并且参考了网上大多数解决方法都不行,最后找到一个最终的解决方法,这才搞定,但愿可以帮到每个路过的入门者。

报错信息
[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.

翻译一下就是您正在使用Vue的仅运行时版本,并而模板编译器不可用。 可以将模板预编译为渲染函数,也可以使用包含编译器的内部版本。。。。一脸懵逼有没有???小朋友表示有太多的问号。


解决方案
在vue项目下新建一个vue.config.js

文件内容为

module.exports = {
  //Solution For Issue: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.
  //zhengkai.blog.csdn.net
  runtimeCompiler: true
}

原文链接:https://robin.blog.csdn.net/article/details/118493362

栏目分类
最近更新