使用谷歌调试页面时,出现如下错误提示:
Uncaught TypeError: Cannot read property ‘events’ of undefined
场景是这样的,我页面中有几个按钮,当点击这几个按钮就会出现如下提示,原本这个按钮的效果应该是出现弹窗的,但是却一直报这样的错,因为我是搞后端的,以为这个问题头疼了半天,怎么都找不到原因,最终一边边测试,终于发现的错误的地方,所以记录分享下。
下面是我弹窗内文字框的代码,原因就在其中,就是因为在第15行多打了一个逗号,报错原因确实可笑,还是不够细心,又是一次教训。
items: [{defaults: {anchor: '90%'},items: [_txtNumber, _txtArea, _txtAuthorName]}, {defaults: {anchor: '90%'},items: [_txtBoxName, _txtPort, _txtCreateTime]}, {defaults: {anchor: '90%'},items: [_txtBoxIP, , _txtOperateTime, _txtOperatorName]}, {defaults: {anchor: '90%'},items: [_txtUUID, _txtOperateCode, _txtPinYinCode, _txtOperatorKey, _txtAuthorKey, _txtStatus]}]