Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

el-table-infinite-scroll

yujinpan27.1kMIT3.0.7TypeScript support: included

Infinite scroll for el-table.

table-infinite-scroll, el-table, infinite-scroll, element-plus

readme

el-table-infinite-scroll

Infinite scroll for el-table.

This directive only does event forwarding, which is equivalent to replacing the target DOM of ElInfiniteScroll with the scroll layer of ElTable.

Documentation

https://yujinpan.github.io/el-table-infinite-scroll

vue3 + element-plus

Install

** Version >= 3 **

npm install --save el-table-infinite-scroll@3

Usage

Global register

import { createApp } from "vue";
import App from "./src/App.vue";

import ElTableInfiniteScroll from "el-table-infinite-scroll";

const app = createApp(App);

app.use(ElTableInfiniteScroll);
app.mount("#app");

Component register

<template>
  <el-table v-el-table-infinite-scroll="load"></el-table>
</template>

<script setup>
import { default as vElTableInfiniteScroll } from "el-table-infinite-scroll";
</script>

Example

<template>
  <el-table
    v-el-table-infinite-scroll="load"
    :data="data"
    :infinite-scroll-disabled="disabled"
    height="200px"
  >
    <el-table-column type="index" />
    <el-table-column prop="date" label="date" />
    <el-table-column prop="name" label="name" />
    <el-table-column prop="age" label="age" />
  </el-table>
</template>

<script setup>
import { ref } from "vue";

const dataTemplate = new Array(10).fill({
  date: "2009-01-01",
  name: "Tom",
  age: "30",
});

const data = ref([]);
const disabled = ref(false);
const page = ref(0);
const total = ref(5);

const load = () => {
  if (disabled.value) return;

  page.value++;
  if (page.value <= total.value) {
    data.value = data.value.concat(dataTemplate);
  }

  if (page.value === total.value) {
    disabled.value = true;
  }
};
</script>

Options

Supported element-plus/infinite-scroll all options.

vue2 + element-ui

Install

** Version ^ 2 **

npm install --save el-table-infinite-scroll@2

Usage

Global register

import Vue from "vue";

import ElTableInfiniteScroll from "el-table-infinite-scroll";

Vue.directive("el-table-infinite-scroll", ElTableInfiniteScroll);

Component register

<script>
import ElTableInfiniteScroll from "el-table-infinite-scroll";

export default {
  directives: {
    "el-table-infinite-scroll": ElTableInfiniteScroll,
  },
};
</script>

Example

<template>
  <el-table
    v-el-table-infinite-scroll="load"
    :data="data"
    :infinite-scroll-disabled="disabled"
    height="200px"
  >
    <el-table-column type="index" />
    <el-table-column prop="date" label="date" />
    <el-table-column prop="name" label="name" />
    <el-table-column prop="age" label="age" />
  </el-table>
</template>

<script>
const dataTemplate = new Array(10).fill({
  date: "2009-01-01",
  name: "Tom",
  age: "30",
});

export default {
  data() {
    return {
      data: [],
      page: 0,
      total: 5,
    };
  },
  methods: {
    load() {
      if (this.disabled) return;

      this.page++;
      if (this.page <= this.total) {
        this.data = this.data.concat(dataTemplate);
      }

      if (this.page === this.total) {
        this.disabled = true;
      }
    },
  },
};
</script>

Options

Supported element-ui/infinite-scroll all options.

Contribution

Thanks to JetBrains for supporting my free open source license.

JetBrains

changelog

3.0.7 (2025-06-17)

Bug Fixes

  • Scrollbar element not found when using custom namespace (ade5e48)

3.0.6 (2024-07-12)

3.0.5 (2024-05-29)

3.0.4 (2024-05-29)

3.0.3 (2023-09-18)

Bug Fixes

  • use Object.assign replace {...} (libs will require @babel/runtime) (b75152a)

3.0.2 (2023-09-18)

Bug Fixes

  • define type with install property (8e82fb8)
  • unmounted failed (0c1bae1)

Features

  • add base dev dictionary (e1830e0)
  • develop environment upgrade to vite (01fc12c)
  • directive upgrade to vue3 (45e90b4)

2.0.2 (2024-05-29)

3.0.5 (2024-05-29)

3.0.4 (2024-05-29)

3.0.3 (2023-09-18)

Bug Fixes

  • use Object.assign replace {...} (libs will require @babel/runtime) (b75152a)

3.0.2 (2023-09-18)

Bug Fixes

  • define type with install property (8e82fb8)
  • unmounted failed (0c1bae1)

Features

  • add base dev dictionary (e1830e0)
  • develop environment upgrade to vite (01fc12c)
  • directive upgrade to vue3 (45e90b4)

2.0.1 (2024-05-29)

Bug Fixes

  • attribute not update when remove (c57777c)
  • windows/chrome's scrollTop + clientHeight !== scrollHeight (82bdb1b)
  • 修改未设置表格高度时的判断问题 (7075418)
  • 表格未设置高度时会导致一直加载问题 (c44ae37)
  • 表格未设置高度时会导致一直加载问题 (422cb3a)
  • 配置选项设置无效问题 (fac0591)

Features

  • add TS and RollupX develop environment (7f0b2dc)
  • 增加 github pages (203f88d)
  • 增加对【el-infinite-scroll】的配置项的支持 (45b6137)
  • 增加测试用例的滑动提示 (2f5b64f)
  • 增加测试选项 (391b432)