3208关注10668浏览
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; },
-
至过去的我
2044人对此回答表示赞同
我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>