1.0.10 • Published 2 months ago

vue-virt-list v1.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

vue-virt-list 虚拟列表 虚拟滚动列表

👉 Advantages

Documentation

To check out docs, visit vue-virt-list

Quick Start

npm install vue-virt-list -S

Options API

<template>
  <div style="width: 500px; height: 400px">
    <VirtList itemKey="id" :list="list" :minSize="20">
      <template #default="{ itemData, index }">
        <div>{{ index }} - {{ itemData.id }} - {{ itemData.text }}</div>
      </template>
    </VirtList>
  </div>
</template>

<script>
  import { VirtList } from 'vue-virt-list';
  export default {
    components: { VirtList },
    data() {
      return {
        list: [{ id: 0, text: 'text' }],
      };
    },
  };
</script>

Composition API

<template>
  <div style="width: 500px; height: 400px">
    <VirtList itemKey="id" :list="list" :minSize="20">
      <template #default="{ itemData, index }">
        <div>{{ index }} - {{ itemData.id }} - {{ itemData.text }}</div>
      </template>
    </VirtList>
  </div>
</template>

<script setup lang="ts">
  import { ref, shallowRef } from 'vue';
  import { VirtList } from 'vue-virt-list';
  const list = ref([{ id: 0, text: 'text' }]);

  // 大数据建议使用 shallowRef,自行使用renderKey控制响应式,具体参考demo文档:
  // https://keno-lee.github.io/vue-virt-list/examples/huge-data/
  // const list = shallowRef([{ id: 0, text: 'text' }])
</script>
1.0.10

2 months ago

1.0.9

2 months ago

1.0.8

2 months ago

1.0.7

3 months ago

1.0.6

3 months ago

1.0.5

3 months ago

1.0.4

3 months ago

1.0.3

3 months ago

1.0.3-beta.0

3 months ago

1.0.3-beta.1

3 months ago

1.0.2

4 months ago

1.0.1

4 months ago

1.0.0

4 months ago