收藏
回答

运维中心报错内容 'setData' of null

框架类型 问题类型 API/组件名称 终端类型 操作系统 微信版本 基础库版本
小程序 Bug this.setData({}) 客户端 6.6.7 2.1.0

input 输入框 关键字查询,当input输入框为空时,显示设置refreshIconShow为show显示刷新按钮,当输入框有值时隐藏刷新按钮。在开发者工具调试未出现过问题。真机测试未报错程序正常运行,但在运维中心偶尔会监控到Cannot read property 'setData' of null。 

代码://获取input信息   inpuKeyword:function(e){     var keyword = e.detail.value;     keyword = keyword.replace(/(^\s+)|(\s+$)/g,"");     if(keyword==""){         this.getTerminalList();         if(this.data.refreshIconShow == "hidden"){           this.setData({             refreshIconShow: "show"           });         }     }else{       if(this.data.refreshIconShow == "show"){         this.setData({           refreshIconShow: "hidden"         });       }     }     this.data.keyword = keyword;   },

回答关注问题邀请回答
收藏
登录 后发表内容