'Cannot read property'changeSelect' of null' error?

WeChat applet gets the sub-component instance let obj = this.selectComponent('#garden')
error:‘Cannot read property 'changeSelect' of null’ report an error?

It's because : the component is called before loading.
For example , the component reference is placed in wx:else or wx:if, just remove wx:if. Or Deng component is finished calling

Guess you like

Origin blog.csdn.net/men_gqi/article/details/114284707