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

table-auto-scroll

v1.0.4

Published

表格自动滚动

Readme

Table_Auto_Scroll

一、博客

二、简介

  • Vue2 + ElementUI 实现表格自动向下滚动。

三、功能

  • 表格每秒自动向下滚动一个表格行的高度。
  • 滚动到表格底部时回到顶部,再次自动滚动。
  • 鼠标移入表格区域时,暂停自动滚动。
  • 鼠标移出表格区域后,开始自动滚动。

四、使用

1. 安装

npm install table-auto-scroll

2. 前置第三方库

{
    "vue": "^2.6.11",
    "element-ui": "^2.15.14",
    "lodash": "^4.17.21"
}

3. 全局引入

import TableAutoScroll from "table-auto-scroll";
import "table-auto-scroll/dist/table-auto-scroll.css";
Vue.component("TableAutoScroll", TableAutoScroll);

4. 局部引入

import TableAutoScroll from "table-auto-scroll";
import "table-auto-scroll/dist/table-auto-scroll.css";
export default {
    components: {
        TableAutoScroll,
    },
};

5. 基础使用

<template>
    <div class="table-auto-scroll-wrapper">
        <TableAutoScroll :tableHeader="tableHeader" :tableData="tableData" theme="light" />
        <TableAutoScroll :tableHeader="tableHeader" :tableData="tableData" theme="dark" />
    </div>
</template>

<script>
    import TableAutoScroll from "table-auto-scroll";
    import "table-auto-scroll/dist/table-auto-scroll.css";

    export default {
        name: "TableAutoScroll",
        components: {
            TableAutoScroll,
        },
        data() {
            return {
                tableData: [],
                tableHeader: [
                    {
                        prop: "id",
                        label: "排名",
                        width: "50px",
                    },
                    {
                        prop: "name",
                        label: "名称",
                        width: "150px",
                    },
                    {
                        prop: "amount",
                        label: "收入",
                        width: "100px",
                    },
                    {
                        prop: "address",
                        label: "地址",
                    },
                    {
                        prop: "remark",
                        label: "备注",
                    },
                ],
            };
        },
        mounted() {
            // 模拟接口数据
            setTimeout(() => {
                this.tableData = new Array(15).fill({}).map((_, index) => ({
                    id: index + 1,
                    name: "哈哈哈哈哈哈哈哈哈哈哈" + (index + 1),
                    amount: parseFloat(Math.random() * (9999 - 1000) * (index + 1)).toFixed(2),
                    address: "测试地址测试地址测试地址测试地址测试地址测试地址测试地址测试地址" + index + 1,
                    remark: "测试备注测试备注测试备注测试备注测试备注测试备注测试备注测试备注" + index + 1,
                }));
            }, 1000);
        },
    };
</script>

五、个性化

1. 可选主题色

  • dark
  • light
<TableAutoScroll theme="light" />
<TableAutoScroll theme="dark" />

2. 表格高度

<TableAutoScroll tableHeight="500px" />
<TableAutoScroll tableHeight="100vh" />

3. 表头样式

<TableAutoScroll
    :headStyle="{
        background: 'linear-gradient(90deg, #e1f5fe, #b3e5fc)',
        color: '#0277bd',
    }"
></TableAutoScroll>
<TableAutoScroll
    :headStyle="{
        background: '#b3e5fc',
        color: '#0277bd',
    }"
></TableAutoScroll>

4. 表格行样式

  • firstRow:第一行
  • secondRow:第二行
  • thirdRow:第三行
  • oddRow:奇数行
  • evenRow:偶数行
<TableAutoScroll
    :rowStyle="{
        firstRow: {
            background: 'linear-gradient(90deg, #2e7d32, #4caf50)',
            color: '#ffffff',
        },
        secondRow: {
            background: 'linear-gradient(90deg, #4caf50, #81c784)',
            color: '#1b5e20',
        },
        thirdRow: {
            background: 'linear-gradient(90deg, #81c784, #a5d6a7)',
            color: '#0d47a1',
        },
        oddRow: {
            background: 'linear-gradient(90deg, #eceff1, #cfd8dc)',
            color: '#37474f',
        },
        evenRow: {
            background: 'linear-gradient(90deg, #cfd8dc, #b0bec5)',
            color: '#37474f',
        },
    }"
></TableAutoScroll>