reportComplaints.js: Uncaught TypeError: Cannot read property 'message' of undefined
vonic 中遇到这么个问题, 一直提示我未定义, 可是明明有定义
var tab={
message:{
number:'',
title:''
}
}
var id= {
template: '#id',
data: function(){
return tab;
},
created: function () {
//感觉问题就是这
var self = this; },
methods: {
showComplaintsDetail:function(item){
var self = this;
self.tab.message= item; //这样写就会报那个错误
}
}
}
后来发现可能是var self = this; 的问题, 结果去掉后就正常了,或者把tab去掉也可以恢复正常, 感觉就是self获取的this不一样, 有些self中包含tab, 有些包含的是tab中的属性,
这里先简单记一下, 有机会在深入了解
reportComplaints.js: Uncaught TypeError: Cannot read property 'message' of undefined的更多相关文章
- jquery.dataTables.min.js: Uncaught TypeError: Cannot read property 'style' of undefined
原因:datatable表格内容有操作列,而表头没有定义操作列 少写了一行:<th>操作</th>
- VM1059 bootstrap-table.min.js:7 Uncaught TypeError: Cannot read property 'classes' of undefined
参考链接:https://blog.csdn.net/liuqianspq/article/details/81868283 1.阳光明媚的下午,我在写CRUD,让数据传到前端的时候,解析的时候报错了 ...
- index.js:13 Uncaught TypeError: Cannot read property 'split' of undefined
使用 webpack 编译 Vue 项目时出现报错: index.js:13 Uncaught TypeError: Cannot read property 'split' of undefined ...
- Three.js three.js Uncaught TypeError: Cannot read property 'getExtension' of null
在调试Three.js执行加载幕布的时候,突然爆出这个错误three.js Uncaught TypeError: Cannot read property 'getExtension' of nul ...
- 【jQuery】jquery中 使用$('#parentUid').attr(parentUid);报错jquery-1.11.3.min.js:5 Uncaught TypeError: Cannot read property 'nodeType' of undefined
jquery中 使用$('#parentUid').attr(parentUid);报错jquery-1.11.3.min.js:5 Uncaught TypeError: Cannot read p ...
- js 报错 Uncaught TypeError: Cannot read property 'trim' of undefined
jquery Uncaught TypeError: Cannot read property 'trim' of undefined 报错原因及解决方案 $.trim() 函数用于去除字符串两端的空 ...
- underscore.js定义模板遇到问题:Uncaught TypeError: Cannot read property 'replace' of undefined
代码正确缩进位置如下, extend "layout" block 'content',-> div ->'nihao' script id:"Invoice ...
- JS报错:Uncaught TypeError: Cannot set property ‘nTf‘ of undefined
在使用DataTable时,遇到以下报错: Uncaught TypeError: Cannot set property 'nTf' of undefined ... ... 初步排查后发现是< ...
- SignalR代理对象异常:Uncaught TypeError: Cannot read property 'client' of undefined 推出的结论 SignalR 简单示例 通过三个DEMO学会SignalR的三种实现方式 SignalR推送框架两个项目永久连接通讯使用 SignalR 集线器简单实例2 用SignalR创建实时永久长连接异步网络应用程序
SignalR代理对象异常:Uncaught TypeError: Cannot read property 'client' of undefined 推出的结论 异常汇总:http://www ...
随机推荐
- fiddler抓取https请求(android/ios)
本文转载自:http://blog.csdn.net/songer_xing/article/details/53841401 备注:本人有这样的一个需求,先记录下,以后再进行整理. 在抓包过程中发现 ...
- C# ThreadPool类(线程池)
CLR线程池并不会在CLR初始化时立即建立线程,而是在应用程序要创建线程来运行任务时,线程池才初始化一个线程.线程池初始化时是没有线程的,线程池里的线程的初始化与其他线程一样,但是在完成任务以后,该线 ...
- sublime text 安装nodejs开发插件
系统:windows10nodejs版本:v6.1.14 请先配置好环境变量,这里就不说啦. 下载并设置nodejs插件 下载地址为https://github.com/tanepiper/Subli ...
- java体系架构
java概念 java本身是一种面向对象的语言,最显著的特性有两方面,一是所谓的“书写一次,到处运行”(write once ,run anywhrer),能够非常容易的获得跨平台能力,另外就是垃圾收 ...
- class example of C++
#include <iostream> using namespace std; class Rectangle { int width, height; public: ...
- eclipse编写js代码没有提示
安装插件 点击Help,选择Eclipse Marketplace... 搜索js,安装AngularJS Eclipse 重启eclipse,右键项目,选择Configure(配置),选择Conve ...
- JS经典题目解析
此次列举出一些觉得有意思的JS题目(来源于出了名的44题),相信有非常多关于这些题目的博客,写这篇博客的目的在于巩固一些知识点,希望能和读者共同进步. 1. map函数执行过程 ["1&qu ...
- Nginx之OCSP stapling配置
摘要: 正确地配置OCSP stapling, 可以提高HTTPS性能. 什么是OCSP stapling? OCSP的全称是Online Certificate Status Protocol,即在 ...
- mac svn的使用
一.概述 在windows下,我们常常用TortoiseSVN管理svn代码.在mac下,自带svn客户端和服务器端功能. 二.服务端:创建代码仓库,用来存储客户端所上传的代码 (1)创建svn代码存 ...
- Vue之resource请求数据
导入resource文件 <script src="https://cdn.staticfile.org/vue-resource/1.5.1/vue-resource.min.js& ...