vue报错信息
1.Property or method "xxx" is not defined on the instance but referenced during render.
原因:xxx在template或方法中使用了,但是没有在data中定义
2.can not read property ‘xxx’ of undefined 和 can not read propery ‘xxx’ of null
原因:因为 调用这个xxx方法的对象 的数据类型是undefined,所以无法调用报错。类似的报错还有Cannot read property 'xxx' of null 调用方法的对象是null,也是无法调用报错
3.Error in render function: "Type error"
注意,只要出现Error in render,即渲染时候报错,此时应该去渲染位置去找错误,而不是函数里面。
4.Error: listen EADDRNOTAVAIL 192.168.3.83:3030
5.Computed property "xxx" was assigned to but it has no setter.
<template>
<div id="app">
<div>{{number}}</div>
</div>
</template> <script>
export default {
computed:{
number(){
return 123
}
},
created(){
this.number=234; //this.number 是定义再computed的方法函数,不能直接使用修改属性的方式修改
}
}
</script>
6.Duplicate keys detected: '8'. This may cause an update error. 错误
主要时绑定的key出现了重复
看错误的的报告中关键字’keys’,联系错误的时机,可以知道这个错误出现在我使用vue的循环中,循环再vue或者小程序中饭为了保证每一项的独立性,都会推荐使用key,所以综上所述,很可能是key出现问题
很显然后几个的index重复了,所以修改index后,就不再出现此问题了。
7.[Vue warn]: Error in render: "TypeError: Cannot read property 'title' of null"
<template>
<section class="book-info" >
<div class="book-detail">
<h2 class="book-title">{{ book.title }}</h2>
</div>
</section>
</template> <script>
export default {
data(){
return{
book:null
}
},
created(){
http.getBook(this.currentBook.id)
.then(data=>{
this.book=data
console.log(data)
})
}
}
</script>
解决方法
方法1.设置 book类型由null改为Object
data(){
return{
book:Object
}
},
方法2.设置v-if="book !== null"
<template>
<section class="book-info" v-if="book !== null">
<div class="book-detail">
<h2 class="book-title">{{ book.title }}</h2></p>
</div>
</section>
</template> <script>
export default {
data(){
return{
book:null
}
},
created(){
http.getBook(this.currentBook.id)
.then(data=>{
this.book=data
console.log(data)
})
}
}
</script> <style lang="scss" scoped> </style>
vue报错信息的更多相关文章
- vue报错There are multiple modules with names that only differ in casing. This can lead to unexpected behavior when compiling on a filesystem with other case-semantic. Use equal casing. Compare these mod
今天在开发一个新项目时,当安装完依赖包启动项目后报了一个这个错 There are multiple modules with names that only differ in casing.Thi ...
- Vue报错: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'protocol')
Vue报错: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'protocol') 报错信 ...
- SVN Cornerstone 报错信息 xcodeproj cannot be opened because the project file cannot be parsed.
svn点击update 之后,打开xcode工程文件,会出现 xxx..xcodeproj cannot be opened becausethe project file cannot be p ...
- PHP安全编程:不要让不相关的人看到报错信息
没有不会犯错的开发者,PHP的错误报告功 能可以协助你确认和定位这些错误,可以提供的这些错误的详细描述,但如果被恶意攻击者看到,这就不妙了.不能让大众看到报错信息,这一点很重要.做到这一 点很容易,只 ...
- SQL 报错信息整理及解决方案(持续更新)
整理一下自己遇见过的 SQL 各种报错信息及相应解决方法,方便以后查阅,主要平台为 Oracle: ORA-01461: 仅能绑定要插入 LONG 列的 LONG 值: 原因:插入操作时,数据大于字段 ...
- JavaWeb:报错信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
建立了一个Javaweb工程,并在eclipse中配置了Web容器Tomcat.新建的jsp页面,添加一个简单的Java类.可是,JSP页面顶端出现“红色”的报错信息:The superclass & ...
- tomcat部署新的项目的时候出现报错信息: Invalid byte tag in constant pool: 15
上面一堆tomcat启动的提示信息省略掉,下面是报错的具体信息:org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid ...
- PHP安全编程:不要让不相关的人看到报错信息(转)
没有不会犯错的开发者,PHP的错误报告功能可以协助你确认和定位这些错误,可以提供的这些错误的详细描述,但如果被恶意攻击者看到,这就不妙了.不能让大众看到报错信息,这一点很重要.做到这一点很容易,只要关 ...
- JAVA_用_JCO连接_SAP,实现调用SAP_的_RFC_函数(整理)(附一篇看起来比较全面的说明)(JCO报错信息)
// 获取RFC返回的字段值 11 JCoParameterList exportParam = function.getExportParameterList(); 12 String exPara ...
随机推荐
- 聚类——WKFCM
聚类——认识WKFCM算法 作者:凯鲁嘎吉 - 博客园 http://www.cnblogs.com/kailugaji/ 参考文献:Shen H, Yang J, Wang S, et al. At ...
- 在Linux上编译Hadoop-2.4.0实践与总结
问题导读: 1.编译源码前需要安装哪些软件? 2.安装之后该如何设置环境变量? 3.为什么不要使用JDK1.8? 4.mvn package -Pdist -DskipTests -Dtar的作用是什 ...
- ThreadLocal源码调试——“this”作为key
前言:在一次面试过程中被问到ThreadLocal,大家都知道ThreadLocal可以为每个线程单独提供一个副本,从而实现变量间的隔离.在ThreadLocal中set和get操作的key是什么,T ...
- win10 搭建virtualenvwrapper虚拟环境
1. 安装virtualenvwrapper pip install virtualenvwrapper-win 注: linux下运行pip install virtualenvwrapper 2. ...
- ASP.Net在64位环境开发部署常见问题
越来越多的开发团队開始使用64位操作系统作为开发环境,也计划将应用部署在安装有64位操作系统的server上.对于ASP.Net开发人员来说.使用64位环境开发部署须要注意下面几个问题.可在项目过程中 ...
- 游览器发送http请求经过的步骤
OSI参考模型(Open System Interconnection,开放系统互连),全称为开放系统互联参考模型 ,OSI将计算机网络体系结构划分为了七层 TCP/IP协议族(TCP/IP Prot ...
- UVA12265-Selling Land(单调栈)
Problem UVA12265-Selling Land Accept: 137 Submit: 782Time Limit: 3000 mSec Problem Description Inpu ...
- 强化学习(三)—— 时序差分法(SARSA和Q-Learning)
1.时序差分法基本概念 虽然蒙特卡洛方法可以在不知道状态转移概率矩阵的前提下,灵活地求解强化学习问题,但是蒙特卡洛方法需要所有的采样序列都是完整的状态序列.如果我们没有完整的状态序列就无法用蒙特卡洛方 ...
- 第一章 mysql的体系结构与存储引擎
数据库从逻辑上可以分为两部分,一部分负责存储即文件系统,这部分有个更时髦的名字叫存储引擎,存储引擎负责如何把数据以及索引相关的内容以合适的形式组织并存储到磁盘上.另一部分为server部分,负责和用户 ...
- Python-wxpy信息爬取发送至微信(小白级)
Wxpy初体验 1.1 安装wxpy 在这里默认大家以及安装好了pip,我们需要安装wxpy 以及wechat_sender 两个包,这里推荐使用国内的豆瓣源,如果大家网速过硬 请忽略.. 1 2 p ...