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-selector

v1.0.7

Published

``` npm run dev ```

Readme

开发环境运行

npm run dev

编译

npm run build

引用

vue 项目

// 样式
import "table-selector/dist/main.css";

// 业务代码
import { open } from "table-selector";

// 使用
open(options);

原生

<!-- 引入编译好的js与css -->
<script src="table-selector.js"></script>
<link rel="stylesheet" href="main.css" />

<!-- 使用 -->
tableSelector.open(options);

options

classPrefix (可选,string,默认值"table-selector")

类名前缀,冲突时更改。

height (可选,numberstring,默认值504)

弹出层高度。

width (可选,numberstring,默认值760)

弹出层宽度。

title (可选,string,默认值"流程选择")

弹出层标题。

searchPlaceholder (可选,string,默认值"请输入关键字")

搜索框占位符。

tableRowHeight (可选,numberstring,默认值32)

表格每行的高度。

dataTableWidth (可选,numberstring,默认值480)

左侧数据表格的宽度。

pageCount (可选,number,默认值7)

分页按钮最大显示数。

valueProp (可选,string,默认值"id")

右侧已选择表格的值的唯一字段的 key。

labelProp (可选,string,默认值"electronFlowName")

右侧已选择表格的值的显示字段的 key。

columns (可选,array)

列描述数组。

// 默认值
[
  // 每个对象代表一列
  {
    // 列表头
    label: "序号",
    // 列字段名
    prop: "$index",
    // 列宽,支持数字和字符串
    width: 60,
    // 表头对齐方式,默认left
    headerAlign: "center",
    // 表体对齐方式,默认left
    align: "center",
    // 格式化函数,参考el-table
    formatter: (row, column, cellValue, index) => {
      return index + 1;
    },
  },
  {
    label: "PDMC领域",
    prop: "domainInfo",
    width: 110,
  },
  {
    label: "电子流名称",
    prop: "electronFlowName",
  },
  {
    label: "电子流owner",
    prop: "ownerName",
    width: 100,
  },
];

对齐方式可选:leftcenterright

没有设置列宽时会自动撑开,多个列均分。

searchMethod (必填,function)

搜索方法。

// 例子
function searchMethod(params, done) {
  axios({
    method: "post",
    url: "/user/12345",
    data: {
      // 模糊搜索文本
      searchKey: params.keyword,
      // 页码,从1开始
      pageNumber: params.pageNumber,
      // 分页大小,默认10
      pageSize: params.pageSize,
    },
  }).then((result) => {
    if (result.status == 200) {
      // done方法告知组件请求完成
      done({
        // 数组
        rows: result.data,
        // 总条数,默认0
        total: result.total,
      });
    }
  });
}

confirm (必填,function)

确定按钮方法。

// 例子
function confirm(value, close) {
  // value为选择的值的数组
  // 关闭弹窗
  close();
}