vue-virtual-scroller icon indicating copy to clipboard operation
vue-virtual-scroller copied to clipboard

loading in place of white screen

Open xerosanyam opened this issue 6 years ago • 6 comments

if we scroll the screen fast, we get to see a blank screen. is it possible to show Loading.. somehow?

xerosanyam avatar Aug 10 '18 11:08 xerosanyam

I think by the time we are able to render "Loading" it will actually render the items.

Akryum avatar Aug 10 '18 14:08 Akryum

I think, time to render the items will depend on:

  1. number of nested elements that it has to load
  2. cpu power

time to render "Loading" should be far lesser than time to render nested element.

xerosanyam avatar Aug 11 '18 10:08 xerosanyam

Drawing a frame isn't selective, everything will be rendered.

Akryum avatar Feb 19 '19 15:02 Akryum

Hey!

I added a loading indicator like this:

Template:


            <div class="loader" v-show="isLoading">Some Styled loading Gif...</div>
            <RecycleScroller :items="XXX"
                             :emit-update="true"
                             @update="handleLoadingIndicator"
                             @scroll-start="isLoading=false"
                             @scroll-end="isLoading=false"
                             :buffer="0">
              <template slot-scope="{ item, index }">
                   <Item>...</Item>
              </template>
            </RecycleScroller>

JS (Vue):

  data() {
    return {
      isLoading: false,
    };
  },
    
/* ... */
    
  mounted() {
    this.debounceLoadingCancel = debounce(() => {
      this.isLoading = false;
    }, 500);
  },

/* ... */

  methods: {
    handleLoadingIndicator() {
      if (!this.isLoading) {
        this.isLoading = true;
      }
      this.debounceLoadingCancel();
    },
  }

nicolaskopp avatar Apr 25 '23 15:04 nicolaskopp

Its useless, What a pity! As long as it is loaded, it will load.

guaziing avatar Sep 27 '23 03:09 guaziing

https://github.com/zrj570543941/custome-scroll This project can slow down scrolling. Can you learn from it? Check the source code, I don't know where to start.

guaziing avatar Sep 27 '23 06:09 guaziing