New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

elementui-virtual-table

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elementui-virtual-table

一个基于element-ui 的虚拟滚动列表的封装,支持element-ui 表格的其他属性和方法。

latest
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

背景

一个基于element-ui 的虚拟滚动列表的封装,支持element-ui 表格的其他属性和方法。

  • 设计初衷
    • 因element-ui 没有相关的组件,且业务上会用到巨量数据渲染的问题
  • 设计原理
    • 因为轮子太多,没有参考市面上正常的虚拟列表的做法,采用了数据截取的办法;
    • 利用滚动的高度,截取对应比例的数据展示;
  • 缺点
    • 表格中el-table-column中type,暂时不支持type为index;只能设置为prop="index";
    • 在不开启固定行高的时候,滚动到底部的时候容易造成表格抖动;
    • 无法对select与select-all做修改,只能使用自定义事件接收返回数据;

组件参数prop

参数说明类型默认值
data显示的数据array--
rowKey与element-ui兼容;同时也是组件判断勾选数据的依据Stringid
fixedLineHeight是否启动固定行高(建议极端需求的情况下关闭,否则滑动表格也会出现抖动)Booleantrue
lineHeight表格行高Number || String45
maxHeight表格高度Number || String450
showDataLength截取数据长度Number || String80

组件事件

事件名说明返回值
getSelectAll当用户手动勾选全选checkbox时, 返回勾选数据Array
getSelect当用户手动勾选数据行的checkbox时,返回勾选数据Array

用例

<elementui-virtual-table
  :data="tableData"
  @get-select-all="selectAll"
  @get-select="selectAction"
  rowKey="settleLineId"
>
  <el-table-column
    type="selection"
    reserve-selection
    width="50"
  />
  <el-table-column
    prop="index"
    label="序号"
    width="70"
  />
  <el-table-column
    prop="name"
    label="姓名"
  />
</elementui-virtual-table>

Keywords

elementui

FAQs

Package last updated on 09 Oct 2023

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