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

vue-admin-kit

v1.0.3

Published

企业级 Vue3 后台管理系统组件工具套件,基于 Element Plus 和 VXE-Table,提供开箱即用的 CRUD 页面模板

Readme

vue-admin-kit

npm version license

企业级 Vue 3 后台管理组件工具套件,基于 Element Plus 和 VXE-Table 构建,提供配置驱动的 CRUD 页面模板。

📖 在线文档

✨ 特性

  • 🚀 配置驱动 - 通过 JSON 配置快速生成搜索表单、数据表格、详情弹窗、编辑表单
  • 📦 开箱即用 - 内置 14 种表单控件、字典管理、文件上传、权限指令
  • 🎨 高度可定制 - 支持自定义组件、字典适配器、权限控制
  • 📱 响应式设计 - 根据屏幕尺寸自动调整表单项大小
  • 🔧 TypeScript - 完整的类型定义,提供良好的开发体验

📦 安装

npm install vue-admin-kit
# 或
pnpm add vue-admin-kit
# 或
yarn add vue-admin-kit

Peer Dependencies

pnpm add vue@^3.4.0 element-plus@^2.0.0 vxe-table@^4.0.0 vxe-pc-ui@^4.0.0 xe-utils@^3.0.0 @element-plus/icons-vue@^2.0.0 @vueuse/core@^10.0.0

🚀 快速开始

1. 引入样式

// main.ts
import "vue-admin-kit/style.css";

2. 初始化配置

import { setupPageTemplate } from "vue-admin-kit";
import { getDicts } from "@/api/system/dict";

setupPageTemplate({
  dependencies: {
    dictLoader: async (dictType) => {
      const res = await getDicts(dictType);
      return {
        success: true,
        data: res.data.map((item) => ({
          label: item.dictLabel,
          value: item.dictValue,
          elTagType: item.listClass,
        })),
      };
    },
  },
});

3. 创建 CRUD 页面

<script setup lang="ts">
import { ref } from "vue";
import {
  useState,
  PageTemplate,
  Table,
  defineSearchConfig,
  defineFormConfig,
  defineColumnsConfig,
} from "vue-admin-kit";
import type { PageTemplateExposed } from "vue-admin-kit";

const pageTemplateRef = ref<PageTemplateExposed>();

const searchConfig = defineSearchConfig([
  { type: "input", prop: "name", label: "名称" },
  { type: "select", prop: "status", label: "状态", dictType: "sys_status" },
]);

const formConfig = defineFormConfig([
  { type: "input", prop: "name", label: "名称", required: true },
  { type: "select", prop: "status", label: "状态", dictType: "sys_status" },
]);

const columnsConfig = defineColumnsConfig([
  { type: "seq", title: "序号", width: 60 },
  { field: "name", title: "名称", minWidth: 120 },
  {
    field: "status",
    title: "状态",
    dictType: "sys_status",
    displayType: "tag",
  },
]);

useState({
  api: {
    list: (params) => getList(params),
    add: (data) => addItem(data),
    edit: (data) => updateItem(data),
    delete: (id) => deleteItem(id),
  },
  searchConfig,
  formConfig,
  columnsConfig,
  tableOptions: {
    operateColumns: [
      {
        title: "编辑",
        onClick: (row) => pageTemplateRef.value?.handleEdit(row),
      },
      {
        title: "删除",
        onClick: (row) => pageTemplateRef.value?.handleDelete(row),
      },
    ],
  },
});
</script>

<template>
  <PageTemplate ref="pageTemplateRef">
    <template #table>
      <Table />
    </template>
  </PageTemplate>
</template>

📚 核心功能

表单控件

内置 14 种表单控件,通过 type 属性指定:

| 类型 | 说明 | 类型 | 说明 | | ------------------- | ------------ | -------------- | ------------ | | input | 输入框 | textarea | 多行输入 | | number | 数字输入 | select | 下拉选择 | | radio | 单选 | date | 日期选择 | | time | 时间选择 | upload | 文件上传 | | uploadCard | 卡片上传 | editor | 富文本编辑器 | | line | 分割线 | inputGroup | 输入组 | | addableInputGroup | 可增删输入组 | selectChange | 搜索选择 |

字典管理

import { useDict, useDictLabel, preloadDicts } from "vue-admin-kit";

// 响应式获取字典
const { dictData, loaded } = useDict("sys_status");

// 获取字典标签
const label = useDictLabel("sys_status", "1");

// 预加载字典
await preloadDicts(["sys_status", "sys_yes_no"]);

配置工具

采用"注册-使用"模式,支持配置复用:

import { col, registerColumnConfigs, getColumnConfig } from "vue-admin-kit";

// 注册
registerColumnConfigs([
  col("序号", { type: "seq", width: 60 }),
  col("状态", { field: "status", dictType: "sys_status", displayType: "tag" }),
]);

// 使用
const columns = getColumnConfig(["序号", "状态", ["名称", { minWidth: 200 }]]);

权限指令

<template>
  <el-button v-hasPermi="['system:user:add']">新增</el-button>
  <el-button v-hasRole="['admin']">管理员操作</el-button>
</template>

📖 文档

完整文档请访问:https://vue-admin-kit.jiang.in/

🔗 相关链接

📄 License

MIT © 2025 vue-admin-kit