Component 里有个bindinput提示在parent index页面没有找到?
我在pages/index/index下面用了一个Component,而这个Component里面有个input并且设置bindinput=“searchInput”。在这个Component的js文件里,我已经定义了这个searchInput方法。模拟器没有问题,但是真机运行提示pages/index/index里面没有定义这个searchInput。关键是这个是在Component里的。难道每个在Component里bind了还要在它的parent页面又要bind一次?
/pages/index/index.wxml<discover></discover>/pages/discover/home/home.wxml<input type="text" bindinput="searchInput"></input>/pages/discover/home/home.jsmethods: { searchInput(e) { this.setData({ query: e.detail.value }) },} |
