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

@guoliwei/bw-table

v1.0.0

Published

Vue3 + Element Plus 增强表格组件,支持搜索、分页、列设置、多选等

Readme

@your-scope/pro-table

Vue3 + Element Plus 增强表格组件,支持搜索表单、分页、列设置、多选、拖拽排序等。

安装

npm i @your-scope/pro-table
# 或
pnpm add @your-scope/pro-table

依赖:请确保项目已安装 vue@^3.3element-plus@^2.4@element-plus/icons-vue。表格内部使用 sortablejsvuedraggable,已作为 dependencies 安装。

样式:包内已包含 ProTable 所需的全局样式(.card.table-main.table-search.table-header 等),引入包样式后即可正常显示,无需在业务项目中再写一套。若项目已定义 --gray-* 等变量,会优先使用项目的;未定义时使用 Element Plus 变量作为 fallback。

使用

全局注册

import ProTable from "@your-scope/pro-table";
import "@your-scope/pro-table/style.css"; // 若有打包样式

app.component("ProTable", ProTable);

按需使用

<template>
  <ProTable
    :columns="columns"
    :request-api="getList"
    row-key="id"
  />
</template>
<script setup>
import ProTable from "@your-scope/pro-table";
import "@your-scope/pro-table/style.css";

const columns = [
  { prop: "name", label: "姓名", search: { el: "input" } },
  { prop: "status", label: "状态", enum: statusOptions, tag: true },
  { prop: "operation", label: "操作", fixed: "right" },
];
const getList = (params) => api.getList(params); // 需返回 { data, totalElements }
</script>

权限按钮(可选)

若需要与项目权限体系对接(操作列按钮权限),在 ProTable 外层 provide 当前页允许的按钮码列表:

import { ref } from "vue";
const authButtons = ref(["add", "edit", "delete"]); // 从权限接口或 store 获取
provide("proTableAuthButtons", authButtons);

不 provide 时,操作列所有按钮均展示。

Props / 事件 / 插槽

与现有 ProTable 保持一致,如:columnsrequestApirequestAutopaginationrowKeysearchColtoolButton 等;事件 searchresetdargSortcreate;插槽 tableHeaderselectButtonpaginationempty 及各列插槽。

构建与发布 npm

packages/pro-table 目录下:

pnpm install
pnpm build

发布前请将 package.jsonname 改为你的 scope 或包名(如 @myorg/pro-tablemy-pro-table),然后:

npm login
npm publish

若为 scoped 且公开发布:npm publish --access public

从当前项目迁移

若从本仓库的 src/components/ProTable 迁移到该包,只需将页面中的:

  • import ProTable from "@/components/ProTable/index.vue"
    改为
  • import ProTable from "@your-scope/pro-table"
    并引入样式(若需要)。列配置、API 入参/出参、插槽名保持不变即可。