Consistent naming of $state functions
I think it'd be better if you name the $state functions similar. Currently, it's loaded, but the other function is namedcomplete. Wouldn't completed be better?
Thanks for your advice! It's my mistake because of my native language is not English, so the lexical may not precise. But I don't think it's a good time to change the API, it will affect many developers and their applications, how do you think about it?
You could wait and introduce that change when you have other breaking changes you'd publish. I think that'd be a good time to do that. ☺️
Agree completely! I will fix it in the next milestone version.
Sorry for hijacking, but what do the status codes mean? I'd like to reset only if loading has already completed, so I get the status: this.$refs.infiniteLoading.status but it comes back as 1, and all the references to status in the vue file are STATUS.word. How can I tell which code means which status?
@TravisHeeter please use identifier way to reset this component, the status code just use to the internal logic, it is not recommended that modify the status code manually.
@PeachScript OK, I tried identifier, but no luck. I have an array of records, which are managed by infinite-loader, and I set the identifier to the record count: totalRecords.
The problem happens when I add 10 records. totalRecords increases by 10 and I want infinite-loader to recognize this and start loading the new rows when the user scrolls down, however it does not acknowledge the new records until I reload the page.
Here's my code:
<infinite-loading
:distance="10"
@infinite="loadMoreRecords"
ref="infiniteLoading"
:identifier="totalRecords">
I actually have a stackOverflow question for this: https://stackoverflow.com/questions/54044709/how-to-reset-vue-infinite-loading-ie-get-a-variable-from-a-child-component
@TravisHeeter it would be better if you can create a new issue with a reproduce link.
I created a new issue: https://github.com/PeachScript/vue-infinite-loading/issues/215
I also updated my SO question to better describe my situation. I also created a Code Pen to show the code (I didn't get infinite-loader to work in the code pen, but it works on my real site).
But basically, when the user adds rows, infinite-loader should load more rows.