vue-infinite-loading icon indicating copy to clipboard operation
vue-infinite-loading copied to clipboard

Consistent naming of $state functions

Open TheAlexLichter opened this issue 8 years ago • 8 comments

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?

TheAlexLichter avatar Sep 24 '17 00:09 TheAlexLichter

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?

PeachScript avatar Sep 24 '17 13:09 PeachScript

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. ☺️

TheAlexLichter avatar Sep 24 '17 13:09 TheAlexLichter

Agree completely! I will fix it in the next milestone version.

PeachScript avatar Sep 24 '17 14:09 PeachScript

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 avatar Jan 04 '19 19:01 TravisHeeter

@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 avatar Jan 06 '19 05:01 PeachScript

@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 avatar Jan 07 '19 13:01 TravisHeeter

@TravisHeeter it would be better if you can create a new issue with a reproduce link.

PeachScript avatar Jan 07 '19 14:01 PeachScript

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.

TravisHeeter avatar Jan 07 '19 16:01 TravisHeeter