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

el-crud-page

v1.0.5

Published

A powerful CRUD page component library for Element UI v2

Readme

el-crud-page

一个基于 Element UI v2 的强大 CRUD 页面组件库,简化表格、表单和查询的开发。

特性

  • 🚀 开箱即用的 CRUD 页面组件
  • 📋 灵活的表格配置
  • 📝 自动表单生成
  • 🔍 查询表单支持
  • 🎨 完全兼容 Element UI v2
  • 💪 TypeScript 支持

安装

npm install el-crud-page
# 或
yarn add el-crud-page

依赖

本库需要以下依赖(需要在你的项目中安装):

  • Vue 2.6+
  • Element UI 2.x

使用

完整引入

import Vue from 'vue';
import { Crud, CrudTabledForm, QueryForm } from 'el-crud-page';

Vue.component('Crud', Crud); 

按需引入

import { Crud } from 'el-crud-page';

export default {
  components: {
    Crud
  }
}

组件说明

Crud

主组件,集成了表格、表单和查询功能。

CrudTable

表格组件,基于 Element UI 的 Table 组件封装。

CrudForm

表单组件,基于 Element UI 的 Form 组件封装。

QueryForm

查询表单组件,用于数据筛选。

基础示例

<template>
  <crud
    ref="crud"
    :columns="columns"
    :query-items="queryItems"
    :buttons="buttons"
    @action="handleAction"
    @row-action="handleRowAction"
  />
</template>
 

完整示例

更完整的示例请参考 examples/App.vue

API 说明

Crud Props

| 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | columns | 表格列配置 | Array | [] | | queryItems | 查询表单配置 | Array | [] | | buttons | 顶部按钮配置,可以是数组或函数 | Array/Function | [] | | tabPanes | 标签页配置 | Array | [] | | queryLineClamp | 查询表单行数限制 | Number | 1 | | queryLabelWidth | 查询表单标签宽度 | Number | 80 | | queryInputWidth | 查询表单输入框宽度 | Number | 210 |

Crud Events

| 事件名 | 说明 | 回调参数 | | --- | --- | --- | | action | 顶部按钮点击事件 | (action, selections) | | row-action | 行内按钮点击事件 | (action, scope) | | tabChange | 标签页切换事件 | (tabKey) |

Crud Methods

| 方法名 | 说明 | 参数 | | --- | --- | --- | | setService | 设置服务接口 | (service) service对象包含 page/add/update/delete/info 等方法 | | refresh | 刷新列表数据 | - |

列配置 (columns)

{
  type: 'selection', // 列类型: selection/index/expand
  prop: 'name',      // 字段名
  label: '名称',     // 列标题
  width: 120,        // 列宽度
  fixed: 'left',     // 固定列: left/right
  sortable: true,    // 是否可排序
   
}

查询表单配置 (queryItems)

 

按钮配置 (buttons)

// 数组形式
buttons: [
  {
    text: '新增',
    type: 'primary',
    icon: 'el-icon-plus',
    action: 'add',
    plain: false,
    disabled: false
  }
]

// 函数形式(可根据选中数据动态配置)
buttons: (selections) => {
  return [
    {
      text: '批量删除',
      type: 'danger',
      action: 'batchDelete',
      disabled: selections.length === 0
    }
  ];
}

开发

# 安装依赖
npm install

# 开发模式
npm run dev

# 构建
npm run build

License

MIT

作者

tonwe