Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-virtual-draglist

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-virtual-draglist

一个支持拖拽排序和虚拟滚动的表格组件

  • 1.0.9
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
362
decreased by-31.83%
Maintainers
1
Weekly downloads
 
Created
Source

可拖拽排序的表格组件(暂不支持拖拽和表格)

Simple usage

npm i vue-virtual-draglist -D

Root component:

<template>
  <div>
    <virtual-drag-list
      :data-key="'uid'"
      :data-source="list"
    >
      <template #item="{ record, index, dataKey }">
        {{ record.text }}
      </template>
      <template slot="header"></template>
      <template slot="footer"></template>
    </virtual-drag-list>
  </div>
</template>

<script>
  import virtualDragList from 'vue-virtual-draglist'

  export default {
    name: 'root',
    data () {
      return {
        list: [{id: '1', text: 'asd'}, {uid: '2', text: 'fgh'}, ...]
      }
    },
    components: { virtualDragList }
  }
</script>

Props type

Required props

PropTypeDescription
data-keyString每一条数据的唯一标识
data-sourceArray数据源

Optional props

Commonly used

           Prop           TypeDefaultDescription
keepsNumber30虚拟滚动展示的数据量
sizeNumber50每一条数据的预估高度,可选择传或不传,会自动计算

Public methods

Usefull public methods

使用 ref 去获取组件内部的方法

MethodDescription
scrollToBottom()滚动到底部
scrollToIndex(index)滚动到指定index值位置
scrollToOffset(offset)滚动到指定高度

Keywords

FAQs

Package last updated on 18 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc