this.selectComponent('') 报错问题

‘Cannot read property 'changeSelect' of null’

​ 今天遇到微信小程序的问题挺奇葩的,搞了半天,发现selectComponent这个方法只有在组件(展示)在页面的时候才能获取到组件,如果隐藏或者wx:if之后便会报这个错。

posted @ 2020-03-30 19:15  baiyis  阅读(3056)  评论(0编辑  收藏  举报