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

terminal-h5-components

v1.1.0

Published

使用 npm 安装:

Readme

Terminal H5 Components

安装

使用 npm 安装:

npm install terminal-h5-components

使用

按需引入组件 如果你只需要引入特定的组件,例如 CTable:

import { CTable } from 'terminal-h5-components'

// 使用 CTable 组件

引入整个库 如果你想引入整个组件库:

import TerminalH5Components from 'terminal-h5-components'

table 组件

API
  • columns (Array): 表格列的配置数组,每个列对象包含以下属性:

    • dataIndex (String): 列数据在数据项中对应的 key。
    • title (String): 列标题。
    • slotScope (String, 可选): 插槽名称,用于自定义列内容。
    • ellipsis (Boolean, 可选): 是否显示省略号。
    • width (Number, 可选): 列宽度。
    • key (String, 可选): 列的唯一标识。
  • dataSource (Array): 表格数据源数组。

  • rowKey (String): 表格行的唯一标识字段。

  • total (Number): 数据总条数。

  • pageType (String, 可选): 翻页方式 默认scroll 滚动翻页,可配置button为分页导航器

  • rowHeight (Number, 可选): 行高,默认值为 getRelativeSizeBasedOnWidth(66)

  • checkable (Boolean, 可选): 是否显示复选框,默认值为 false

  • loading (Boolean, 可选): 是否显示加载状态,默认值为 false

事件
  • load (Function): 加载更多数据时触发,参数为 pageNumpageSize

  • check (Function): 复选框状态变化时触发,参数为选中的数据数组。

示例
<template>
  <table-component
    :columns="columns"
    :dataSource="dataSource"
    rowKey="id"
    pageType="scroll"
    :total="total"
    :checkable="true"
    :loading="loading"
    @load="handleLoad"
    @check="handleCheck"
  />
</template>

<script setup lang="ts">
import { ref } from 'vue'
import TableComponent from '@/components/table/index.vue'

const columns = [
  { dataIndex: 'name', title: '姓名' },
  { dataIndex: 'age', title: '年龄' },
  { dataIndex: 'address', title: '地址' },
]

const dataSource = ref(
  Array.from({ length: pageSize }, (v, i) => {
    return { id: pageSize * i, name: '张三', age: 22, address: '北京' }
  }),
)

const total = ref(100)
const loading = ref(false)

function handleLoad(pageNum: number, pageSize: number) {
  // 加载更多数据的逻辑
}

function handleCheck(selectedRows: any[]) {
  // 处理选中的数据
}
</script>