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 🙏

© 2025 – Pkg Stats / Ryan Hefner

q-scroll-list

v1.0.3

Published

vue3+ts 列表数据向上滚动

Downloads

6

Readme

q-scroll-list

Vue 3 + Typescript + Vite

数据列表向上滚动、无感更新数据

安装

npm https://www.npmjs.com/package/q-scroll-list

npm install q-scroll-list
or
yarn add q-scroll-list

main.js

import QScrollList from 'q-scroll-list';
import "q-scroll-list/index.css";
const app = createApp(App);
app.use(QScrollList);

//简单使用
<script setup lang="ts">
import { ref } from "vue";
let data = ref([] as any[]);
let scrollList = ref(null);
let config = ref({
  header: {
    data: ["名称", "类型", "状态", "情况", "日期"],
    height: 40,
    color: "#fff",
    borderColor: "pink",
    borderSize: 1,
  },
  data: data,
  pageSize: 7,
});
const selectItem = (id: string, rowIndex: number, colIndex: number) => {
  console.log(id, rowIndex, colIndex);
};
data.value = [
  { id: "1", value: [1, 2, 3, 4, 5] },
  { id: "2", value: [2, 2, 3, 4, 5] },
  { id: "3", value: [3, 2, 3, 4, 5] },
  { id: "4", value: [4, 2, 3, 4, 5] },
  { id: "5", value: [5, 2, 3, 4, 5] },
  { id: "6", value: [6, 2, 3, 4, 5] },
  { id: "7", value: [7, 2, 3, 4, 5] },
  { id: "8", value: [8, 2, 3, 4, 5] },
  { id: "9", value: [9, 2, 3, 4, 5] },
  { id: "10", value: [10, 2, 3, 4, 5] },
  { id: "11", value: [11, 2, 3, 4, 5] },
  { id: "12", value: [12, 2, 3, 4, 5] },
  { id: "13", value: [13, 2, 3, 4, 5] },
  { id: "14", value: [14, 2, 3, 4, 5] },
  { id: "15", value: [15, 2, 3, 4, 5] },
  { id: "16", value: [16, 2, 3, 4, 5] },
];
setTimeout(() => {
  //一步更新数据
  (scrollList.value as any).pushData([
    { id: "17", value: [17, 22, 23, 24, 25] },
    { id: "18", value: [18, 22, 23, 24, 25] },
    { id: "19", value: [19, 22, 23, 24, 25] },
    { id: "20", value: [20, 22, 23, 24, 25] },
  ]);
}, 10000);
</script>

<template>
  <img alt="Vue logo" src="./assets/logo.png" />
  <div class="bg" style="width:500px;height:300px;margin:0 auto">
    <QScrollList :config="config" @selectItem="selectItem" ref="scrollList"></QScrollList>
  </div>
</template>

事件

| 回调方法 | 返回参数 | 参数类型 | 返回说明 | | ------------- | ------------------------ | --------------- | ------------- | | @selectItem | (id,rowIndex,colIndex) | (int,int,int) | 点击行返回 id | | pushData | (data) | (array) | 异步更新数据 |

参数 config

| 参数名 | 参数类型 | 说明 | | | ------------- | -------------- | ------------------------------------------- | --- | | header | HeaderObject | 表头配置 | | type | string | 单行滚动:single 分页滚动:page | | data | object[] | 列表数据{id:'xx',value:['xx','hh']} | | pageSize | number | 一页展示多少行 | | columnWidth | number[] | 每列的间隔[,,20,]这样第三列为 20,其他列等分 | | waitTime | number | 动画执行间隔时间 | | selectBg | string | 鼠标点击行的背景颜色 | | singleBg | string | 奇行背景颜色 | | doubleBg | string | 偶行背景颜色 |

注意:
  data 必须包含id及value
  value为每列的数据可以为html字符

参数 HeaderObject

| 参数名 | 参数类型 | 说明 | | | ------------- | ---------- | ----------------------- | --- | | size | number | 字体大小 | | color | string | 字体颜色 | | data | string[] | 表头数据['姓名','公司'] | | height | number | 表头行高 | | borderColor | number[] | 表头下的 border 颜色 | | borderSize | number | 表头下的 border 大小 |

图片

Customize configuration

See Configuration Reference.