1.0.2 • Published 3 years ago

vue3-virtual-list v1.0.2

Weekly downloads
40
License
MIT
Repository
github
Last release
3 years ago

vue3-virtual-list

npm downloads vue3

Scroll list for big acount of data. Based on Vue3.

live demo

Install

yarn add vue3-virtual-list

Example

<template>
  <div class="list-container">
    <VirtualList :data="dataSource">
      <template v-slot="{ item, index }">
        <div class="item-container">
          <div class="cell cell-index">{{ index + 1 }}</div>
          <div class="cell">{{ item.name }}</div>
          <div class="cell">{{ item.email }}</div>
          <div class="cell">{{ item.address }}</div>
        </div>
      </template>
    </VirtualList>
  </div>
</template>

<script>
  import { VirtualList } from 'vue3-virtual-list';
  import { mock } from './utils';

  export default {
    data() {
      return {
        dataSource: mock(100000),
      };
    },
    components: {
      VirtualList,
    },
  };
</script>

<style>
  .list-container {
    width: 800px;
    height: 600px;
    border: 2px solid #4caf50;
    margin: 0 auto;
  }
  .item-container {
    height: 40px;
    display: flex;
    flex-direction: row;
    align-items: center;
    border-bottom: 1px solid #ccc;
  }
</style>

Props

nametypedescriptionrequireddefault
dataArrayThe array of data. Every item is a row.Yes
dataKeyStringField as key.Noid
itemSizeNumberThe height in pixels of each row.No40
poolBufferNumberHow many rows will be rendered except for the visible ones.No50
1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

1.0.0-alpha2

3 years ago

1.0.0-alpha3

3 years ago

1.0.0-alpha4

3 years ago

1.0.0-alpha5

3 years ago

1.0.0-alpha6

3 years ago

1.0.0-alpha7

3 years ago

1.0.0-alpha1

3 years ago