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

vue3-virtualized

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

vue3-virtualized

Vue3 components for efficiently rendering large, scrollable lists and tabular data

latest
Source
npmnpm
Version
0.0.5
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

vue3-virtualized

It was inspired by react-window.

vue3-virtualized-gif

Run example

cd examples
yarn install
yarn dev

VariableSizeList

<template>
  <VariableSizeList
    :height="150"
    :item-size="getItemSize"
    :item-count="1000"
  >
    <template #default="{ data, index, key, isScrolling  }">
      <Row
        :index="index"
        :rowData="data"
        :isScrolling="isScrolling"
        @click="handleClickRow(data, index)"
      />
    </template>
  </VariableSizeList>
</template>

<script>
import { VariableSizeList } from 'vue3-virtualized'

const Row = {
  name: 'Row',
  props: {
    index: {
      type: Number
    },
    rowData: {

    },
  },

  setup(props) {
    return () => {
      return (
        <div style="border: 1px solid">Row {props.index}</div>
      )
    }
  }
};

const rowHeights = new Array(1000).fill(true).map(() => 25 + Math.round(Math.random() * 50));
const getItemSize = index => rowHeights[index];

export default {
  name: 'VariableSizeListDemo',
  components: {
    VariableSizeList,
    Row,
  },
  data() {
    return {
      rowHeights,
      getItemSize,
    }
  },
  methods: {
    handleClickRow(rowData, index) {
      console.log(`click row ${index}`)
    }
  }

}


</script>

Keywords

vue

FAQs

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