Infinite scroller
The v-infinite-scroll component displays a potentially infinite list, by loading more items of the list when scrolling. It supports either vertical or horizontal scrolling.
Guide
The v-infinite-scroll
component is a container that allows you to react to a user reaching the end of content area. It is useful when you need to display an unknown but large number of items, and you don’t want to load them all at once.
Props
The v-infinite-scroll
component has a number of props that can be used to customize its behaviour.
Mode
The default behaviour of the component is to try to load more content automatically when the scrollbar gets close to the end. However a manual mode is also supported, where the user needs to do some interaction to load the content. By default this a button, but it can be customized with a slot.
Direction
The v-infinite-scroll
component can be used with either vertical and horizontal scrolling.
Side
By default the v-infinite-scroll
component assumes that new content will be appearing at the end of existing content. But it also supports content being added to the start, and content appearing both at the start and the end.
When using the start
side for content, the scrolllbar will start at the bottom of the content.
When using both
sides for content, the scrollbar will start in the middle of the content.
Color
The default load more button and loading spinner can be colored with the color
prop.
Loading
You can customize the loading message with the loading
slot.
Load more
When using manual
mode you can customize the action required to load more content with the load-more
slot.
Empty
You can customize the empty message with the empty
slot.
Error
The error
slot is shown if the status 'error'
is returned from the done
callback.
Examples
The following are a collection of examples that demonstrate more advanced and real world use of the v-infinite-scroll
component.
Virtualized infinite scroller
If the items in your infinite list are of a uniform size, you can quite easily virtualize the list to only render a small amount of items regardless of how far you scroll in either direction.
CONTENTS
Introduction
Mode
Direction
Side
Both side
Color
Loading
Load more
Empty
Error
Virtualized infinite scroller