npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

types-vue-virtual-scroller

v1.0.2

Published

Type declaration file of vue-virtual-scroller

Readme

types-vue-virtual-scroller

版本 许可证

简介

types-vue-virtual-scrollervue-virtual-scroller 的 TypeScript 类型声明文件包。它提供了完整的类型定义,让您在使用 TypeScript 开发 Vue 3 应用时能够获得更好的开发体验。

特性

  • vue-virtual-scroller 提供完整的 TypeScript 类型支持
  • 支持 Vue 3 和 Composition API
  • 包含所有组件的详细属性类型定义
  • 提供方法和事件的类型声明

安装

# 使用 npm
npm install @types/vue-virtual-scroller@npm:types-vue-virtual-scroller --save-dev

# 使用 yarn
yarn add @types/vue-virtual-scroller@npm:types-vue-virtual-scroller --dev

# 使用 pnpm
pnpm add @types/vue-virtual-scroller@npm:types-vue-virtual-scroller -D

支持的组件

该类型声明包包含以下组件的类型定义:

  • RecycleScroller:高效渲染大量数据的基础滚动组件
  • DynamicScroller:自动处理不同高度项目的动态滚动组件
  • DynamicScrollerItem:配合 DynamicScroller 使用的项目组件

使用示例

<script setup lang="ts">
import { RecycleScroller, DynamicScroller, DynamicScrollerItem } from 'vue-virtual-scroller'
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'

// 使用 RecycleScroller (固定高度项目)
const items = ref(Array.from({ length: 1000 }).map((_, i) => ({ id: i, text: `Item ${i}` })))

// 使用 DynamicScroller (动态高度项目)
const dynamicItems = ref(Array.from({ length: 1000 }).map((_, i) => ({ 
  id: i, 
  text: `Dynamic Item ${i}`, 
  size: Math.floor(Math.random() * 100) + 50 
})))
</script>

<template>
  <!-- 固定高度列表 -->
  <RecycleScroller
    class="scroller"
    :items="items"
    :item-size="50"
    key-field="id"
  >
    <template #default="{ item }">
      <div class="item">{{ item.text }}</div>
    </template>
  </RecycleScroller>

  <!-- 动态高度列表 -->
  <DynamicScroller
    class="scroller"
    :items="dynamicItems"
    :min-item-size="50"
    key-field="id"
  >
    <template #default="{ item, index, active }">
      <DynamicScrollerItem
        :item="item"
        :active="active"
        :size-dependencies="[item.text]"
      >
        <div class="item">{{ item.text }}</div>
      </DynamicScrollerItem>
    </template>
  </DynamicScroller>
</template>

类型定义

该包提供以下主要接口:

  • RecycleScrollerProps:RecycleScroller 组件的属性类型
  • DynamicScrollerProps:DynamicScroller 组件的属性类型
  • DynamicScrollerItemProps:DynamicScrollerItem 组件的属性类型
  • PluginOptions:插件安装选项类型

类型声明模块

该类型包使用 declare module 语法声明了 vue-virtual-scroller 模块的类型:

declare module 'vue-virtual-scroller' {
  export { RecycleScroller, DynamicScroller, DynamicScrollerItem }

  export interface PluginOptions {
    // 配置选项...
  }

  const VueVirtualScroller: {
    version: string
    install(app: App, options?: PluginOptions): void
  }

  export default VueVirtualScroller
}

TypeScript 配置

为确保类型声明正常工作,请在您的 tsconfig.json 中包含以下配置:

{
  "compilerOptions": {
    "types": ["vue-virtual-scroller"]
  }
}

贡献

欢迎提交问题和改进建议!请通过 GitHub Issues 或 Pull Requests 提供您的反馈。

许可证

ISC

作者

fncheng