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

╰半橙微兮° 2023-02-23 12:17 154阅读 0赞

问题背景

今天在入门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
在这里插入图片描述
文件内容为

  1. module.exports = {
  2. //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.
  3. //zhengkai.blog.csdn.net
  4. runtimeCompiler: true
  5. }

开源项目

学习Vue(待上线)
http://github.com/moshowgame/vue-study

发表评论

表情:
评论列表 (有 0 条评论,154人围观)

还没有评论,来说两句吧...

相关阅读