[Vue warn]: Failed to mount component: template or render function not defined. 错误解决方法
解决方法
import Vue from "vue"; 默认引入的文件是 vue/dist/vue.runtime.common.js。这个可以在node_modules/vue/package.json文件里面查到。package文件的main选项指定了默认执行的文件。关键的package.json代码如下:

这个代码说明了 vue.runtime.common.js 文件不含编译器,因此不支持template选项。我们使用Webpack和template选项的话,可以使用vue.common.js文件。vue.common.js文件包含编译器。所以在main.js中把

修改为:

这样一来就可以正常使用 vue 文件
[Vue warn]: Failed to mount component: template or render function not defined. 错误解决方法的更多相关文章
- "[Vue warn]: Failed to mount component: template or render function not defined"错误的解决
VUE中动态路由出错: vue.esm.js?a026: [Vue warn]: Failed to mount component: template or render function not ...
- [Vue warn]: Failed to mount component: template or render function not defined.解决方案
命名视图 vue router 里有一个 模式叫做 命名视图 本来一个页面里面只能有一个路由视图 对应 一个组件,现在可以多个路由视图 对应 多个组件. 出错点 点击标签之后,<router-v ...
- [Vue warn]: Failed to mount component: template or render function not defined. found in ---> <XFbwz> at src/views/XFbwz.vue <App> at src/App.vue <Root>
1.引入.vue文件忘记加.vue 2.引入文件内容为空
- Failed to mount component: template or render function not defined.
Failed to mount component: template or render function not defined. vue-loader13.0有一个变更就是默认启用了esModu ...
- template or render function not defined vue 突然报错了,怎么解决
报错图例如下:template or render function not defined vue 突然报错了,怎么解决什么错误呢,就是加载不出来,网上看了一通,是vue版本不对,是vue-comp ...
- template or render function not defined.
template or render function not defined. H_婷 关注 2018.08.16 17:22 字数 106 阅读 3859评论 0喜欢 2 下午写 Vue $par ...
- [问题]编译报错:clang: error: linker command failed with exit code 1及duplicate symbol xxxx in错误解决方法之一
今天添加了一个新类(包括m,h,xib文件),还没有调用,-编译遇到如下错误,根据错误提示, duplicate symbol param1 in: /Users/xxxx/Library/Devel ...
- [报错]编译报错:clang: error: linker command failed with exit code 1及duplicate symbol xxxx in错误解决方法之一
今天添加了一个新类(包括m,h,xib文件),还没有调用,—编译遇到如下错误,根据错误提示, duplicate symbol param1 in: /Users/xxxx/Library/Devel ...
- [Vue warn]: Do not mount Vue to <html> or <body> - mount to normal elements instead.
官方文档是这么解释的: 提供的元素只能作为挂载点.不同于 Vue 1.x,所有的挂载元素会被 Vue 生成的 DOM 替换.因此不推荐挂载root实例到 <html> 或者 <bod ...
随机推荐
- HTML 技巧
超过指定宽度以".."显示 width:80px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;
- LeetCode 704. Binary Search (二分查找)
题目标签:Binary Search 很标准的一个二分查找,具体看code. Java Solution: Runtime: 0 ms, faster than 100 % Memory Usage ...
- 【Web】浅析JQuery的apply(), call(), bind()方法
原文地址:https://blog.csdn.net/whuzxq/article/details/64166253 由于在理解this的用法的时候多次出现了这几个方法,个人对这几个方法理解的不是很透 ...
- [Java]读取文件方法大全(转载)
1.按字节读取文件内容2.按字符读取文件内容3.按行读取文件内容4.随机读取文件内容 public class ReadFromFile { /** * 以字节为单位读取文件,常用于读二进制文件,如图 ...
- Appium 环境配置遇到的坑
一般基础的python路径,sdk等网上都有教程,在这里不多说. 一般可能没有的包:opencv4nodejs ,ffmpeg,bundletoo,jar 1.opencv4nodejs 使用npm安 ...
- uoj74 【UR #6】破解密码
题目 发现这个题的本质就是在做\(\rm hash\) 我们显然能够列出\(n\)个方程,之后高消,这是\(O(n^3)\)的 但是观察一下第一个和第二个方程 \[a_{1}26^{n-1}+a_{2 ...
- LinkedHashMap+Spring Aop实现简易的缓存系统
之前介绍说要做在线文库的系统,当数据量大的时候,根据标签tag的对文档信息的查询将是一个很耗时的工作,原来分析LinkedHashMap源码的时候了解到它有一个双向链表的结构,可以通过将刚被访问的元素 ...
- 搜索框下面显示提示数据(数据是ajax读取)
1.前台页面 <div style="margin: 0 auto"> <input type="text" id="wenxian ...
- Python中虚拟环境venv的基本用法
环境windows 7 venv为python3中的默认库,无需安装. 创建新的venv方法, 在当前文件夹下执行cmd,输入如下代码 python -m venv bob bob为需要创建的文件夹名 ...
- scala中的闭包简单使用
object Closure { /** * scala中的闭包 * 函数在变量不处于其有效作用域内,还能够对变量进行访问 * * @param args */ def main(args: Arra ...