-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_this.$refs.infiniteLoading.$emit is not a function #57
Comments
Same issue |
@tengqingya @emkman could you reproduce this problem on JSFiddle? |
@emkman maybe is this reason? . When ref is used together with v-for, the ref you get will be an array containing the child components mirroring the data source. |
@PeachScript I have the same issue. it seems to be happened when a view is changed while some resource is loading. const things = await fetchSomething() // the view(page) is changed while waiting for `fetchSomething`
this.$refs.loader.$emit('$InfiniteLoading:loaded') What is the reason that the code is still working even after the view is changed? It could be related with vuejs/vue-router#1181? |
Oh...sounds like that, thanks! I think If we plan to use |
同样的问题,请问怎么解决? |
未加载完成就停止,就会出现该错误。 |
持续关注中..... |
@zzmm1 ,感谢,但我还没找到比较好的解决办法,也许应该换一种使用方式 |
Hi everyone @tengqingya @emkman @feinimoshu753 @jkiimm @zzmm1 @xuyukuan , I think this problem cannot be fixed if this component still use So I plan to change the way to send the ...
infiniteHandler(state) {
ajax('https://www.google.com', (data) => {
if (data.length) {
state.loaded();
} else {
state.complete();
}
});
}
... What do you think? And how about the variable name Best regards. |
Hi everyone, v2.2.0 has been released, include this change, you can try it now, please feedback to here if you find any problem, thanks :D |
oh! I have the same issue with v2.2.0(vue v2.4.3).
|
@FEcorlin did you |
No updates, I will close this issue, you can reopen it if you need in the future. |
Hi, I have a question - I need to stop loader depending on some condition in one of the methods, that has nothing to do with
so I'm getting [Vue-infinite-loading warn], which is tripping me up and it seems like there's no other way - |
@Bruddah you can use the |
nice |
code:
loadMore: function () { console.log("loadMore") getChartDetail({id: this.charts[this.activeIndex]['id'],offset:this.chartsArray[this.activeIndex].length}).then(e=>{ this.chartsArray[this.activeIndex].push(...e.books) this.$refs.infiniteLoading&&this.$refs.infiniteLoading.$emit('$InfiniteLoading:loaded'); }).catch(e => { console.log(e) }) }
first time it will work,but when i continue to scroll ,next time will produce error ‘_this.$refs.infiniteLoading.$emit is not a function’
The text was updated successfully, but these errors were encountered: