• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

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

武飞扬头像
程序员海军
帮助1

学新通
报错信息

[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的仅运行时版本,并而模板编译器不可用。 可以将模板预编译为渲染函数,也可以使用包含编译器的内部版本

在主入口渲染的组件方式不一样,上面这种是采用的 render函数渲染 ,没有进行 runtime-only 配置,所以报错了。

解决方案

在 vue.config.js 中进行配置 runtimeCompiler 为 true 即可。

module.exports = {
   
  runtimeCompiler: true,

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhfikghf
系列文章
更多 icon
同类精品
更多 icon
继续加载