Closed AO-IO closed 5 years ago
Any answer?
Any answer???
We need an answer please, how can we recall the function
Hey guys @heidarv @Sakthi002 @seunafara I solved this problem by this issue
first, add the ref="infiniteLoading"
second, call the function when you want
Tada..!
Here is how you can refresh the data of InfiniteScroll: According to this part of documentation (https://peachscript.github.io/vue-infinite-loading/guide/use-with-filter-or-tabs.html)
Add a identifier
prop to InfiniteLoading
component
<InfiniteLoading
:identifier="infiniteId"
@infinite="infiniteHandler"
></InfiniteLoading>
Add the infiniteId
data to your component data
:
data: function() {
return {
list: [],
infiniteId: +new Date() // It will generate a random value based on current time
}
}
Add a new method into your Vue component, i will call it refreshInfiniteLoading
methods: {
refreshInfiniteLoading() {
this.page = 1
this.list = []
// as said in the documentation
// "The infinite loading component will
// reset itself whenever the identifier property has changed"
this.infiniteId += 1
},
}
Every time you want to refresh your data just call refreshInfiniteLoading
method.
Hi. thank you for the package. This package is the best so far for infinite scrolling !!!
I use vue-infinite-loading in my comments component. usually before using vue-infinite-loading when I add a comment I call a fetch method to see the new data.
I'm using Laravel.
How is it possible to fetch newly added comments?
I tried to reset the status in a method but that didn't work (i saw that in a StackOverflow question)
I can't figure this out. :\ thank you