⚡️ Blazing fast scrolling for any amount of data

Overview

vue-virtual-scroller

npm npm vue2

Blazing fast scrolling of any amount of data | Live demo | Video demo

For Vue 3 support, see here

💚️ Become a Sponsor

Sponsors

sponsors logos

Table of contents

Installation

npm install --save vue-virtual-scroller

⚠️ vue-virtual-scroller now uses vue-observe-visibility to automatically refresh itself when shown to prevent display glitches. This means you need to include the Intersection Observer polyfill needed by vue-observe-visibility for this to work in old browsers (like Internet Explorer).

Default import

Install all the components:

import Vue from 'vue'
import VueVirtualScroller from 'vue-virtual-scroller'

Vue.use(VueVirtualScroller)

Use specific components:

import Vue from 'vue'
import { RecycleScroller } from 'vue-virtual-scroller'

Vue.component('RecycleScroller', RecycleScroller)

⚠️ The line below should be included when importing the package:

import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'

Browser

<link rel="stylesheet" href="vue-virtual-scroller/dist/vue-virtual-scroller.css"/>

<script src="vue.js"></script>
<script src="vue-virtual-scroller/dist/vue-virtual-scroller.min.js"></script>

If Vue is detected, the plugin will be installed automatically. If not, install the component:

Vue.use(VueVirtualScroller)

Or register it with a custom name:

Vue.component('RecycleScroller', VueVirtualScroller.RecycleScroller)

Usage

There are several components provided by vue-virtual-scroller:

RecycleScroller is a component that only renders the visible items in your list. It also re-uses components and dom elements to be as efficient and performant as possible.

DynamicScroller is a component that wraps the RecycleScroller component and extends its features to include dynamic size management. The main use case for this is when you do not know the size of the items in advance. The Dynamic Scroller automatically "discovers" item dimensions as it renders new items during scrolling.

DynamicScrollerItem must wrap each item in a DynamicScroller to handle size computations.

IdState is a mixin that ease the local state management in reused components inside a RecycleScroller.

RecycleScroller

RecycleScroller is a virtual scroller that only renders the visible items. As the user scrolls, RecycleScroller reuses all components and DOM nodes to maintain optimal performance.

Basic usage

Use the scoped slot to render each item in the list:

<template>
  <RecycleScroller
    class="scroller"
    :items="list"
    :item-size="32"
    key-field="id"
    v-slot="{ item }"
  >
    <div class="user">
      {{ item.name }}
    </div>
  </RecycleScroller>
</template>

<script>
export default {
  props: {
    list: Array,
  },
}
</script>

<style scoped>
.scroller {
  height: 100%;
}

.user {
  height: 32%;
  padding: 0 12px;
  display: flex;
  align-items: center;
}
</style>

Important notes

  • ⚠️ You need to set the size of the virtual-scroller element and the items elements (for example, with CSS). Unless you are using variable size mode, all items should have the same height (or width in horizontal mode) to prevent display glitches.
  • ⚠️ If the items are objects, the scroller needs to be able to identify them. By default it will look for an id field on the items. This can be configured with the keyField prop if you are using another field name.
  • It is not recommended to use functional components inside RecycleScroller since the components are reused (so it will actually be slower).
  • The list item components must be reactive to the item prop being updated without being re-created (use computed props or watchers to properly react to props changes!).
  • You don't need to set key on list content (but you should on all nested <img> elements to prevent load glitches).
  • The browsers have a size limitation on DOM elements, it means that currently the virtual scroller can't display more than ~500k items depending on the browser.
  • Since DOM elements are reused for items, it's recommended to define hover styles using the provided hover class instead of the :hover state selector (e.g. .vue-recycle-scroller__item-view.hover or .hover .some-element-inside-the-item-view).

How does it work?

  • The RecycleScroller creates pools of views to render visible items to the user.
  • A view holds a rendered item, and is reused inside its pool.
  • For each type of item, a new pool is created so that the same components (and DOM trees) are reused for the same type.
  • Views can be deactivated if they go off-screen, and can be reused anytime for a newly visible item.

Here is what the internals of RecycleScroller look like in vertical mode:

<RecycleScroller>
  <!-- Wrapper element with a pre-calculated total height -->
  <wrapper
    :style="{ height: computedTotalHeight + 'px' }"
  >
    <!-- Each view is translated to the computed position -->
    <view
      v-for="view of pool"
      :style="{ transform: 'translateY(' + view.computedTop + 'px)' }"
    >
      <!-- Your elements will be rendered here -->
      <slot
        :item="view.item"
        :index="view.nr.index"
        :active="view.nr.used"
      />
    </view>
  </wrapper>
</RecycleScroller>

When the user scrolls inside RecycleScroller, the views are mostly just moved around to fill the new visible space, and the default slot properties updated. That way we get the minimum amount of components/elements creation and destruction and we use the full power of Vue virtual-dom diff algorithm to optimize DOM operations!

Props

  • items: list of items you want to display in the scroller.
  • direction (default: 'vertical'): scrolling direction, either 'vertical' or 'horizontal'.
  • itemSize (default: null): display height (or width in horizontal mode) of the items in pixels used to calculate the scroll size and position. If it is set to null (the default value), it will use variable size mode.
  • minItemSize: minimum size used if the height (or width in horizontal mode) of a item is unknown.
  • sizeField (default: 'size'): field used to get the item's size in variable size mode.
  • typeField (default: 'type'): field used to differentiate different kinds of components in the list. For each distinct type, a pool of recycled items will be created.
  • keyField (default: 'id'): field used to identify items and optimize managing rendered views.
  • pageMode (default: false): enable Page mode.
  • prerender (default: 0): render a fixed number of items for Server-Side Rendering (SSR).
  • buffer (default: 200): amount of pixel to add to edges of the scrolling visible area to start rendering items further away.
  • emitUpdate (default: false): emit a 'update' event each time the virtual scroller content is updated (can impact performance).

Events

  • resize: emitted when the size of the scroller changes.
  • visible: emitted when the scroller considers itself to be visible in the page.
  • hidden: emitted when the scroller is hidden in the page.
  • update (startIndex, endIndex): emitted each time the views are updated, only if emitUpdate prop is true

Default scoped slot props

  • item: item being rendered in a view.
  • index: reflects each item's position in the items array
  • active: whether or not the view is active. An active view is considered visible and being positioned by RecycleScroller. An inactive view is not considered visible and is hidden from the user. Any rendering-related computations should be skipped if the view is inactive.

Other Slots

<main>
  <slot name="before"></slot>
  <wrapper>
    <!-- Reused view pools here -->
  </wrapper>
  <slot name="after"></slot>
</main>

Example:

<RecycleScroller
  class="scroller"
  :items="list"
  :item-size="32"
>
  <template #before>
    Hey! I'm a message displayed before the items!
  </template>

  <template v-slot="{ item }">
    <div class="user">
      {{ item.name }}
    </div>
  </template>
</RecycleScroller>

Page mode

The page mode expands the virtual-scroller and uses the page viewport to compute which items are visible. That way, you can use it in a big page with HTML elements before or after (like a header and a footer). Set the page-mode prop to true:

<header>
  <menu></menu>
</header>

<RecycleScroller page-mode>
  <!-- ... -->
</RecycleScroller>

<footer>
  Copyright 2017 - Cat
</footer>

Variable size mode

⚠️ This mode can be performance heavy with a lot of items. Use with caution.

If the itemSize prop is not set or is set to null, the virtual scroller will switch to variable size mode. You then need to expose a number field on the item objects with the size of the item element.

⚠️ You still need to set the size of the items with CSS correctly (with classes for example).

Use the sizeField prop (default is 'size') to set the field used by the scroller to get the size for each item.

Example:

const items = [
  {
    id: 1,
    label: 'Title',
    size: 64,
  },
  {
    id: 2,
    label: 'Foo',
    size: 32,
  },
  {
    id: 3,
    label: 'Bar',
    size: 32,
  },
]

Buffer

You can set the buffer prop (in pixels) on the virtual-scroller to extend the viewport considered when determining the visible items. For example, if you set a buffer of 1000 pixels, the virtual-scroller will start rendering items that are 1000 pixels below the bottom of the scroller visible area, and will keep the items that are 1000 pixels above the top of the visible area.

The default value is 200.

<RecycleScroller :buffer="200" />

Server-Side Rendering

The prerender props can be set as the number of items to render on the server inside the virtual scroller:

<RecycleScroller
  :items="items"
  :item-size="42"
  :prerender="10"
>

DynamicScroller

This works just like the RecycleScroller, but it can render items with unknown sizes!

Basic usage

<template>
  <DynamicScroller
    :items="items"
    :min-item-size="54"
    class="scroller"
  >
    <template v-slot="{ item, index, active }">
      <DynamicScrollerItem
        :item="item"
        :active="active"
        :size-dependencies="[
          item.message,
        ]"
        :data-index="index"
      >
        <div class="avatar">
          <img
            :src="item.avatar"
            :key="item.avatar"
            alt="avatar"
            class="image"
          >
        </div>
        <div class="text">{{ item.message }}</div>
      </DynamicScrollerItem>
    </template>
  </DynamicScroller>
</template>

<script>
export default {
  props: {
    items: Array,
  },
}
</script>

<style scoped>
.scroller {
  height: 100%;
}
</style>

Important notes

  • minItemSize is required for the initial render of items.
  • DynamicScroller won't detect size changes on its own, but you can put values that can affect the item size with size-dependencies on DynamicScrollerItem.
  • You don't need to have a size field on the items.

Props

Extends all the RecycleScroller props.

  • It's not recommended to change sizeField prop since all the size management is done internally.

Events

Extends all the RecycleScroller events.

Default scoped slot props

Extends all the RecycleScroller scoped slot props.

Other slots

Extends all the RecycleScroller other slots.

DynamicScrollerItem

The component that should wrap all the items in a DynamicScroller.

Props

  • item (required): the item rendered in the scroller.
  • active (required): is the holding view active in RecycleScroller. Will prevent unnecessary size recomputation.
  • sizeDependencies: values that can affect the size of the item. This prop will be watched and if one value changes, the size will be recomputed. Recommended instead of watchData.
  • watchData (default: false): deeply watch item for changes to re-calculate the size (not recommended, can impact performance).
  • tag (default: 'div'): element used to render the component.
  • emitResize (default: false): emit the resize event each time the size is recomputed (can impact performance).

Events

  • resize: emitted each time the size is recomputed, only if emitResize prop is true.

IdState

This is convenience mixin that can replace data in components being rendered in a RecycleScroller.

Why is this useful?

Since the components in RecycleScroller are reused, you can't directly use the Vue standard data properties: otherwise they will be shared with different items in the list!

IdState will instead provide an idState object which is equivalent to $data, but it's linked to a single item with its identifier (you can change which field with idProp param).

Example

In this example, we use the id of the item to have a "scoped" state to the item:

<template>
  <div class="question">
    <p>{{ item.question }}</p>
    <button @click="idState.replyOpen = !idState.replyOpen">Reply</button>
    <textarea
      v-if="idState.replyOpen"
      v-model="idState.replyText"
      placeholder="Type your reply"
    />
  </div>
</template>

<script>
import { IdState } from 'vue-virtual-scroller'

export default {
  mixins: [
    IdState({
      // You can customize this
      idProp: vm => vm.item.id,
    }),
  ],

  props: {
    // Item in the list
    item: Object,
  },

  // This replaces data () { ... }
  idState () {
    return {
      replyOpen: false,
      replyText: '',
    }
  },
}
</script>

Parameters

  • idProp (default: vm => vm.item.id): field name on the component (for example: 'id') or function returning the id.

License

MIT

Issues
  • fix: avoid infinite loop on scrollToBottom with unknown sized elements

    fix: avoid infinite loop on scrollToBottom with unknown sized elements

    fix #221

    I've changed the termination condition to when the scrollTop value is not changed since the previous update.

    Also added requestAnimationFrame during the loop because we need to wait delayed processing in RecycleView after triggering scroll event and DOM update.

    To check the behavior the scroll to bottom example has been updated not to specify fixed size for each item.

    opened by ktsn 22
  • how to use inside a table which has a header

    how to use inside a table which has a header

    How do i use it within an existing table that has a header?

    Since it wraps the content with two divs, it doesnt work here:

    <table>
      <thead><tr><th>...</th><th>...</th></tr>
      <virtual-scroller content-tag="tbody">
        <template>
            <tr>....</tr>
        <template>
      </virtual-scroller>
    </table>
    

    the content becomes treated as a cell, since it is a div, not a row (tr)

    question 
    opened by tonypee 19
  • Only last item visible

    Only last item visible

    First of all, thank you for the work you're doing. Really appreciate it.

    Anyhow, when updating to the new version and trying to change over to dynamicScroller I get it to scroll smoothly but only the last item (or at least I think it's the last one) is visible. So obviously I'm missing something but I can't find what it is. Worth mentioning is that when I'm scrolling down really fast I can see glimpses of the items but when I scroll back up they're not there anymore.

    Here's my implementation:

    <DynamicScroller
    style="height: 75vh"
    :items="dataToDisplay" 
    :min-item-height="200">
    	<template slot-scope="{ item, index, active }">
    		<DynamicScrollerItem
    		:item="item"
    		:active="active"
    		:data-index="index">
    		
    		    <v-card
    		    style="margin: 10px 0px;"
    		    class="rw-card card-hover">
    			<v-card-actions
    			 style="float: right;">
    				<v-spacer/>
    				<v-btn icon	flat color="error" @click="exclude(item)">
    					<v-icon>close</v-icon>
    				</v-btn>
    			 </v-card-actions>
    	                 <!--- .... all the card content here... -->
    		     </v-card>
    		</DynamicScrollerItem>
    	</template>
    </DynamicScroller>
    

    And importing the components as:

    import { DynamicScroller } from 'vue-virtual-scroller'
    import { DynamicScrollerItem } from 'vue-virtual-scroller'
    
    export default {
    	  props: ["input"],
    	  components:{
    		  DynamicScroller: DynamicScroller,
    		  DynamicScrollerItem: DynamicScrollerItem
    	  },
    

    Anyone got an idea of what I'm doing wrong?

    Addon 1: After further investigation it seems like it's rendering but outside of the viewport. So if i set height: 50% on the scroller i can scroll down and get one element showed and if using pagemode and then scrolling on the page I can scroll down and see everything but one element at the time, so somehow only one item is active.

    opened by karatekaneen 16
  • Insert new item and scroll to the end (chat/stream)

    Insert new item and scroll to the end (chat/stream)

    So I'm currently working on a chat using this package for a more performant solution on how we render our chat items.

    Since chats work a bit different to normal lists I have some issues with the implementation of the automated scrolling when new messages are added. Also updates and resizing just resets the scroll position if changed manually via el.scrollTop = 1000 for example. Do I need to tell the component that the scroll position was updated and needs to be saved?

    scrollToItem isn't working for me, because it always scrolls to the beginning of the item instead of the end. Maybe implementing a scrollToEnd and scrollToStart would be good!

    Here is a codesandbox link: https://codesandbox.io/s/jn121l1n83

    enhancement 
    opened by bdbch 11
  • Future of vue-virtual-scroller

    Future of vue-virtual-scroller

    Hello fellow watchers,

    I'm looking for some maintainers to continue the upkeep of this library along with myself.

    As we are all aware, there's been no releases or commits in this project since May. No issues or pull requests have been taken up. This is to no fault of Akryum – many of us do not pay for this software, and as such he is under no obligation to respond to these tickets.

    However, it goes without saying there are bugs that need fixing, fixes that need merging, and features that need coding, all piling up with nobody to care for them – and all of these need oversight to make sure they're good to go into production.

    I have contacted the maintainer over email to no avail, and his account looks fairly inactive. Until progress resumes on this repo, I have opened a fork at AkryumInfinitum/vue-virtual-scroller where I will start testing and merging PRs, as well as working on issues.

    As time goes on, I may take other popular projects of his that have lost steam and pull them over, which is why it is sitting in its own organization.

    If anyone is interested in being a fellow maintainer of this fork, you can email me at [email protected]

    opened by EricRabil 9
  • Can I submit a PR for horizontal scroll ?

    Can I submit a PR for horizontal scroll ?

    I've had a brief look through the code, and it seems that it wouldn't be too difficult to support horizontal scrolling, unless there are any technical reasons, of course, as browsers default to vertical.

    I propose:

    • adding a new prop direction to take vertical | horizontal
      • alternatively, axis to take x | y
    • modifying anything to do with height to size
    • adding computed properties for internals which depending on direction return the right values for:
      • height or y
      • width or x

    I'm happy to start this tomorrow as I think it would be the solution to an issue I have right now on a live project.

    Would this be OK @Akryum ?

    question 
    opened by davestewart 9
  • min-item-height problem

    min-item-height problem

    @Akryum Hello! First of all thanks for your great work! It's userful for my program.

    I am using the DynamicScroller component and set its minItemHeight 36px as required. As you say:

    minItemHeight is required for the initial render of items.

    Then I add an element with 79px height (or unknown height) and emit scrollToItem function but its position is not correct. I view the console and find that the component seems to calculate the element(unknown height)'s height as the minItemHeight.

    How can I fix this problem? I am looking forward to your suggestion. Thanks a lot.

    enhancement 
    opened by AceLing 8
  • Height function

    Height function

    TL;DR: Ability to provide a "height function" instead of setting height on an item.

    The API might be the following: <recycle-list :items="items" :height-fn="item => heights[item.id]">.


    My use case is the following. Items come from a computed property items, and they have variable height with a known approximation (e.g. about 50±20px). The exact height is not known until the component is rendered.

    Because of variable height, components emit their desired height for the given item once it is known.

    But because items come from a computed property, I can not directly set the height on the item object. Instead I have a data field heights, and the computed property items populates heights from this data field.

    The downside is that items list is recalculated every time heights is changing, which is quite often. With a "height function", this recalculation will be avoided.

    feature-request 
    opened by simplesmiler 7
  • vue-virtual-scroller isn't updating when the data changes

    vue-virtual-scroller isn't updating when the data changes

    Demo: https://jsfiddle.net/9cp1qw8z/2/

    vue-virtual-scroller isn't updating when my data changes. I know the data is reactive based on the demo.

    opened by guanzo 6
  • Emit start and end indexes on change

    Emit start and end indexes on change

    I'm integrating virtual-scroller with Meteor, to fetch items on-demand from the database.

    Added features:

    • Emit start and end indexes on change
    • Support sparse Arrays
    • Enable specifying a 'default' renderer, for when an item doesn't have a type, or doesn't exist at all.
    • Enable disabling the key field, by setting :keyField="false"
    opened by Herteby 6
  • chore(deps): bump url-parse from 1.4.7 to 1.5.3 in /docs-src

    chore(deps): bump url-parse from 1.4.7 to 1.5.3 in /docs-src

    Bumps url-parse from 1.4.7 to 1.5.3.

    Commits
    • ad44493 [dist] 1.5.3
    • c798461 [fix] Fix host parsing for file URLs (#210)
    • 201034b [dist] 1.5.2
    • 2d9ac2c [fix] Sanitize only special URLs (#209)
    • fb128af [fix] Use 'null' as origin for non special URLs
    • fed6d9e [fix] Add a leading slash only if the URL is special
    • 94872e7 [fix] Do not incorrectly set the slashes property to true
    • 81ab967 [fix] Ignore slashes after the protocol for special URLs
    • ee22050 [ci] Use GitHub Actions
    • d2979b5 [fix] Special case the file: protocol (#204)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • weird behavior in vue 3

    weird behavior in vue 3

    I'm using vue 3.2.19 vue-virtual-scroller ^2.0.0-alpha.1

    Here's my code:

    numbers is an generated array of numbers with 200 elements

    <div class="overflow-hidden h-full"> <RecycleScroller class="h-full overflow-y-auto" page-mode :items="numbers" item-size="20" keyfield="id" v-slot="{ item }" > <div class="h-5">{{ item }}</div> </RecycleScroller> </div>

    when on page-mode when scrolling it only displays till like till number 47 when not on page mode when I scroll it really gets messed up all the element is being rendered on top of each other 2021-10-01_12-23-05

    opened by Joebu 0
  • Akryum/vue-virtual-scroller#685 Account for the height of the leading and trailing slots when calculating visible items

    Akryum/vue-virtual-scroller#685 Account for the height of the leading and trailing slots when calculating visible items

    this is testable by setting the .notice class to a 500px height on the dynamic scroller demo

    opened by danatcofo 0
  • Scroller render doesn't account for the height of leading or trailing slots

    Scroller render doesn't account for the height of leading or trailing slots

    Not sure how this is doing it under the covers but heres a video showing what I'm talking about. Screen Recording 2021-09-28 at 5 25 50 PM

    Inside the #before slot we have elements that get toggle to be sticky or relative. The sticky version works fine visually where the elements disappear and are reused smoothly. The relative version treats the area as if it where sticky... i.e preserving the #before slot sizing internally.

    Is there something I can do to force or tell the scoller to use the area in the #before slot as well such that it doesn't have the blank area?

    opened by danatcofo 2
  • Vue 3 DynamicScrollerItem default slot issue

    Vue 3 DynamicScrollerItem default slot issue

    When attempting to implement the DynamicScroller in Vue 3, I'm getting a TypeError: this.$slots.default is not a function exception when I attempt to render the DynamicScrollerItem component. If I remove the component, the exception goes away.

    <DynamicScroller
      :items="filteredLocations"
      :min-item-size="100"
      key-field="uuid"
    >
      <template v-slot="{ item, index, active }">
        <DynamicScrollerItem
          :item="item"
          :active="active"
          :size-dependencies="[
            item.properties.name,
            item.properties.address,
          ]"
          :data-index="index"
        >
          <div>{{item.uuid}}</div>
        </DynamicScrollerItem>
      </template>
    </DynamicScroller>
    

    Using version 2.0.0-alpha.1.

    bug 
    opened by mrsweaters 2
  • enhancement: offset item based on itemsize when using scrollToIndex method

    enhancement: offset item based on itemsize when using scrollToIndex method

    I was running into issues where scrolling to an item index meant the item was not fully in the user's view (element was cut off). Updated vue-virtual-scroller.esm.js below; not sure if the src code should be updated elsewhere but figured I would put this out for discussion at least.

    scrollToItem (index) {
         let scroll;
         if (this.itemSize === null) {
           scroll = index > 0 ? this.sizes[index - 1].accumulator : 0;
         } else {
           scroll = index * this.itemSize;
         }
         let { size } = this.sizes[index];
         let offsetPosition = size ? scroll - size : scroll; 
         this.scrollToPosition(offsetPosition);
       },
    opened by Tmodurr 1
  • It is not behaving as in the demo

    It is not behaving as in the demo

    This is my Component

    image

    computedSObjectFields is an Array of Objects

    and this is the container with a pre defined Height

    image

    And this is the result

    demo

    opened by AllanOricil 0
  • Update package.json, Remove peerDependencies.

    Update package.json, Remove peerDependencies.

    Remove peerDependencies. Edit vue version.

    opened by mlinquan 0
  • `resize` event not firing when multiple RecycleScrollers active

    `resize` event not firing when multiple RecycleScrollers active

    Hi there

    There is a scenario where I have multiple RecycleScrollers rendered at the same time. I make use of the resize event to re-calculate the height my items should be. I noticed that only the resize event of the last-rendered RecycleScroller fires.

    I assume this is a bug with the resize observer being used, just wanted to report it. A workaround would be to use my own resize observer implementation outside the RecycleScroller.

    opened by daniandl 0
  • Why fixed peerDependencies versions?

    Why fixed peerDependencies versions?

    Vue version 2.6.11 is too high. image Can't peerDependencies be removed or downward compatible?

    opened by mlinquan 0
Releases(v1.0.10)
  • v1.0.10(Apr 17, 2020)

  • v1.0.9(Apr 15, 2020)

  • v1.0.7(Apr 15, 2020)

  • v1.0.6(Apr 14, 2020)

    Fixed

    • Item with wrong heights if the scroller is created but hidden while the items are added
    • ssr: template mismatch, closes #343

    Improved

    • sort views after scrolling so text selection is correct, closes #359
    • perf: skip update if the user hasn't scrolled more than min item height
    Source code(tar.gz)
    Source code(zip)
  • v1.0.4(Mar 31, 2020)

  • v1.0.3(Mar 31, 2020)

    New

    • On supported browsers, uses a ResizeObserver to more accurately detect size changes for DynamicScrollerItem

    Improved

    • Improved scrollToBottom implementation

    Fixed

    • Exclude dependencies for esm build (#257, #207)

    Other

    • Updated rollup and build toolchain
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0-rc.2(Feb 21, 2019)

  • v1.0.0-rc.1(Feb 20, 2019)

    BREAKING CHANGES

    • Renamed props in RecycleScroller and DynamicScroller:
    itemHeight => itemSize
    minItemHeight => minItemSize
    heightField => sizeField
    
    • Renamed slots in RecycleScroller and DynamicScroller:
    before-container => before
    after-container => after
    
    • Slot variables changed in DynamicScroller:
    itemWithHeight => itemWithSize
    

    New

    • direction prop (either 'vertical' or 'horizontal')

    Fixed

    • Do not forward keyField prop from DynamicScroller - closes #132 (#133)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0-beta.7(Feb 20, 2019)

    New

    • DynamicScroller: support simple arrays, closes #108

    Fixed

    • DynamicScroller: round height, closes #118
    • use minHeight instead of height on wrapper, closes #92
    • ssr: document could not be defined, closes #112
    • dynamic scroller: invalidate heights instead of clear, closes #130
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0-beta.6(Feb 19, 2019)

  • v1.0.0-beta.5(Feb 10, 2019)

  • v1.0.0-beta.4(Dec 22, 2018)

  • v1.0.0-beta.3(Dec 21, 2018)

  • v1.0.0-beta.2(Oct 9, 2018)

  • v1.0.0-beta.1(Oct 8, 2018)

    Breaking changes

    • virtual-scroller component is removed (it was much slower than the recycling one, and what we need is more performance!).
    • recycle-list was renamed to RecycleScroller

    New

    • DynamicScroller and DynamicScrollerItem components to create virtual scroller with unknown height items. It's fully automatic! :fire:
    • IdState mixin to ease data management for components inside a recycling scroller (components are reused!)

    Improved

    • Docs are completely reworked.
    Source code(tar.gz)
    Source code(zip)
  • v0.12.2(Oct 4, 2018)

    New

    • <recycle-list>: new hidden event (opposite of visible event).
    • <recycle-list>: add before-container slot

    Improved

    • Updated vue-observe-visibility

    Fixed

    • The default target for IOS should be body, closes #73 (#85)
    Source code(tar.gz)
    Source code(zip)
  • v0.12.0(Jun 2, 2018)

  • v0.11.0(Jan 25, 2018)

  • v0.10.5(Oct 30, 2017)

  • v0.10.4(Oct 26, 2017)

    New

    • New 'visible' event emitted when the scroller becomes visible
    • The behavior introduced in 0.10.2 (defer removing previous items) is now disabled by default and enabled with the delay-previous-items boolean prop.
    Source code(tar.gz)
    Source code(zip)
  • v0.10.2(Oct 26, 2017)

    New

    • A 'resize' event is emitted when the virtual-scroller size changes
    • New refs: vm.$refs.itemContainer and vm.$refs.items for the container elements.

    Improved

    • buffer is now applied around the pool.
    • Some unnecessary updates are now skipped.
    • The previous items are removed the next frame. This fixes nasty issues when dealing with items that change their height multiple times or contain horrible things like iframes.
    • The first update is now skipped if the scroller has been rendered on the server.
    • Source code: Some syntax and code style changes.
    Source code(tar.gz)
    Source code(zip)
  • v0.10.1(Oct 24, 2017)

    Breaking changes

    • buffer and poolSize are now in pixels and work for both fixed and variable heights modes.

    New

    • emitUpdate boolean prop to enable the new update event when the rendered item list changes.

    Improved

    • Now built using rollup instead of webpack.
    • Distribution files availables: browser, UMD and ES Module.
    Source code(tar.gz)
    Source code(zip)
  • v0.9.0(Sep 18, 2017)

  • v0.8.1(Aug 3, 2017)

    New

    • SSR support
    • New prerender prop (doc)

    Fixes

    • Default import for bundlers that supports modules
    • Handle window resizing in page mode
    • Some initialization issues
    Source code(tar.gz)
    Source code(zip)
  • v0.7.7(Jul 13, 2017)

  • v0.7.5(Jun 27, 2017)

  • v0.7.1(Jun 27, 2017)

  • v0.7.0(Jun 27, 2017)

  • v0.5.1(Jan 9, 2017)

  • v0.4.0(Dec 23, 2016)

Owner
Guillaume Chau
Web & JavaScript enthusiast, @vuejs core team.
Guillaume Chau
⚡️ Blazing fast scrolling for any amount of data

vue-virtual-scroller Blazing fast scrolling of any amount of data | Live demo | Video demo For Vue 3 support, see here ??️ Become a Sponsor Sponsors T

Guillaume Chau 6.1k Oct 13, 2021
Lightweight and simple to use vue component that highlights menu items as you scroll the page, also scrolling to target section when clicked.

vue-scrollactive This component makes it simple to highlight a menu item with an 'active' class as you scroll. Highlights items with a class as you sc

Mauricio Farias Dziedzinski 494 Oct 12, 2021
Lightweight and simple to use vue component that highlights menu items as you scroll the page, also scrolling to target section when clicked.

vue-scrollactive This component makes it simple to highlight a menu item with an 'active' class as you scroll. Highlights items with a class as you sc

Mauricio Farias Dziedzinski 494 Oct 12, 2021
null 1 Oct 8, 2021
⌨️ A Safari browser extension, use keyboard control browser jumps, scrolling, switching tabs and more. support iPadOS and macOS

Support Keyboard Key Description k Scroll up j Scroll down u Fast scroll up d Fast scroll down h Scroll left l Scroll right f Highlight shift Open lin

Haojen 8 Oct 10, 2021
A Vue.js directive for body scroll locking without breaking scrolling of a target element.

v-scroll-lock A Vue.js directive for body scroll locking (for iOS Mobile and Tablet, Android, desktop Safari/Chrome/Firefox) without breaking scrollin

Pete Hegman 167 Oct 12, 2021
A Vue.js directive for body scroll locking without breaking scrolling of a target element.

v-scroll-lock A Vue.js directive for body scroll locking (for iOS Mobile and Tablet, Android, desktop Safari/Chrome/Firefox) without breaking scrollin

Pete Hegman 169 Oct 14, 2021
Customize the scrolling position on route navigation. Especially hash mode.

vue-scroll-behavior Customize the scrolling position on route navigation IE / Edge Firefox Chrome Safari Opera iOS Android IE9+, Edge ✓ ✓ ✓ ✓ ✓ ✓ Tabl

Yazhe Wang 136 Jul 13, 2021
:beginner:A simple, seamless scrolling for Vue.js vue无缝滚动component

vue-seamless-scroll A simple, Seamless scrolling for Vue.js Features Initial configuration support Compatible with multiple platforms Multi-technology

sos 1.3k Oct 12, 2021
Vue component that provides content scrolling and zooming using mouse events or two fingers pinch on a mobile devices

vue-pinch-scroll-zoom Vue component that provides content scrolling and zooming using mouse events or two fingers pinch on a mobile devices example: h

CoddiCat 4 Aug 28, 2021
Starter template for parallax effects & smooth scrolling experience

Nuxt + Locomotive Scroll Starter template for parallax effects & smooth scrolling experience. Empower your Nuxt project in no time. See it in action →

Ivo Dolenc 4 Oct 1, 2021
Handy floating scrollbar component for Vue 3

vue-handy-scroll Handy floating scrollbar component for Vue 3. Synopsis vue-handy-scroll is a component that solves the problem of scrolling lengthy c

null 6 Oct 2, 2021
Component that customizes the scroll and inserts shadow when scrolling exists

Vue Scroll Shadow • • Component that customizes the scroll and inserts shadow when scrolling exists Installation NPM npm i vue-scroll-shadow # or yarn

André Lins 2 Oct 1, 2021
A Vue.js component for detecting when components are visible in the viewport via the Vue.js scoped slots api.

vue-scrollview ScrollView is a Vue.js plugin that includes a set of components and methods for facilitating UI interactions tied to scrolling in your

Chris Hurlburt 113 Jul 20, 2021
nuxt-fullpage is a nuxt module for creating fullscreen page scroll fast and simple.

Nuxt fullpage Nuxt module for creating fullscreen page scroll fast and simple. Demo online Table of contents Installation Usage Options Contributing I

Open Source Afghanistan 9 Oct 6, 2021
Bring your scroll game to the next level!

VueNextLevelScroll - Bring your scroll game to the next level! "Click to scroll" component using the modern Browser API. ?? Features Just one tiny fil

Developmint GbR 49 Mar 2, 2021
Vue directive wrapper for smooth-scrollbar

smooth-vuebar Vue directive wrapper for smooth-scrollbar Demo You can refer to the wrapped library's demo. Why There are many other wrappers for this

Marco 'Gatto' Boffo 25 Aug 16, 2021
Top bar indicating amount of content scrolled

Scrol indicator for vue.js apps Demo See DEMO here Install Run npm install vue-content-scroll-progress --save Usage Add in the component import MyScro

Mikhail Kuznetcov 26 Jul 20, 2021
A scroll loading component for vue.js.

vue-scroll-loader 简体中文 A scroll loading component for vue.js. View demo Browsers Already use IntersectionObserver polyfill compatible with mainstream

John Wu 57 Sep 30, 2021