🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

antd-virtual-table

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

antd-virtual-table

实现antd-table的虚拟列表

latest
Source
npmnpm
Version
0.7.2
Version published
Weekly downloads
9
-10%
Maintainers
1
Weekly downloads
 
Created
Source

antd-virtual-table

NPM

实现 antd-table 的虚拟列表,支持非固定行高、动态改变行高 (antd-table 所有属性均正常可用,如筛选、排序等)

Install

npm install --save antd-virtual-table

Usage

import * as React from "react";
import ReactDom from "react-dom";

import { VList } from "antd-virtual-table";
import { Table } from "antd";

function Example(): JSX.Element {
  const dataSource = [];
  const columns = [];
  const rowKeyList = useMemo(() => dataSource?.map((cv) => cv?.[rest.rowKey]), [
    dataSource,
    rest.rowKey,
  ]);
  const components = useMemo(() => {
    if (virtualTable) {
      return {
        ..._components,
        ...VList({ rowKeyList }),
      };
    }
    return _components;
  }, [_components, virtualTable]);

  return (
    <Table
      dataSource={dataSource}
      columns={columns}
      components={components}
      rowKey={"uuid"}
    />
  );
}

ReactDom.render(<Example />, dom);

Keywords

antd-table

FAQs

Package last updated on 28 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts