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

@chengly/basic

v0.0.6

Published

基于Vue3、Element Plus的通用组件库

Readme

@chengly/components

🎉 基于 Vue 3、Element Plus 的通用表单组件库

✨ 特性

  • 🎨 基于 Element Plus 设计语言
  • 🔥 Vue 3 + JavaScript 支持
  • 📦 开箱即用的高质量表单组件
  • 🛠️ 统一的组件API设计
  • 🎭 支持多种导入方式
  • 📱 支持 ES Module 和 UMD 格式

📦 安装

# npm
npm install @chengly/components

# yarn
yarn add @chengly/components

# pnpm
pnpm add @chengly/components

🚀 快速开始

全局注册

import { createApp } from "vue";
import VueComponents from "@chengly/components";

const app = createApp(App);
// 注册组件库
Object.keys(VueComponents).forEach((key) => {
  if (key !== "default") {
    app.component(key, VueComponents[key]);
  }
});

按需导入

<template>
  <div>
    <!-- 使用输入框组件 -->
    <component :is="inputComponent" />
  </div>
</template>

<script setup>
import { input } from "@chengly/components";

// 动态加载组件
const inputComponent = input(""); // 传入模式参数
</script>

📚 组件列表

🎯 表单组件

  • input - 输入框组件
  • select - 选择器组件
  • checkbox - 复选框组件
  • radio - 单选框组件
  • date - 日期选择器组件
  • time - 时间选择器组件
  • timeSelect - 时间选择组件
  • number - 数字输入框组件
  • color - 颜色选择器组件
  • rate - 评分组件
  • slider - 滑块组件
  • switch - 开关组件
  • cascader - 级联选择器组件
  • tree - 树形控件组件
  • treeSelect - 树形选择器组件
  • transfer - 穿梭框组件
  • autocomplete - 自动完成组件
  • staticInfo - 静态信息展示组件

🎨 使用示例

<template>
  <div class="form-demo">
    <!-- 输入框 -->
    <component :is="inputComponent" />

    <!-- 选择器 -->
    <component :is="selectComponent" />

    <!-- 日期选择器 -->
    <component :is="dateComponent" />
  </div>
</template>

<script setup>
import { input, select, date } from "@chengly/components";

// 加载组件
const inputComponent = input("");
const selectComponent = select("");
const dateComponent = date("");
</script>

📋 组件API

所有组件都基于统一的设计模式:

// 组件函数签名
const component = componentName(mode);
// mode: 组件模式参数,用于不同的渲染方式

📖 依赖要求

必需依赖

  • Vue >= 3.0.0

对等依赖

  • element-plus >= 2.0.0
  • d-render (内部依赖)
  • @d-render/shared (内部依赖)

🌐 浏览器支持

  • Chrome >= 87
  • Firefox >= 78
  • Safari >= 14
  • Edge >= 88

🛠️ 开发

# 安装依赖
pnpm install

# 启动开发服务器
pnpm dev

# 构建组件库
pnpm build:lib

# 代码格式化
pnpm lint:format

📁 项目结构

src/
├── autocomplete/        # 自动完成组件
├── cascader/           # 级联选择器组件
├── checkbox/           # 复选框组件
├── color/              # 颜色选择器组件
├── date/               # 日期选择器组件
├── input/              # 输入框组件
├── number/             # 数字输入框组件
├── radio/              # 单选框组件
├── rate/               # 评分组件
├── select/             # 选择器组件
├── slider/             # 滑块组件
├── static-info/        # 静态信息组件
├── switch/             # 开关组件
├── time/               # 时间选择器组件
├── time-select/        # 时间选择组件
├── transfer/           # 穿梭框组件
├── tree/               # 树形控件组件
├── tree-select/        # 树形选择器组件
├── widgets/            # 工具组件
├── main.js             # 组件集合
└── index.js            # 入口文件

dist/                   # 构建产物
├── index.es.js         # ES模块版本
├── index.umd.js        # UMD版本
└── *.map               # Source Map文件

🤝 贡献

欢迎提交 Pull Request 和 Issue!

📄 许可证

MIT License

🙏 致谢


🔮 路线图

  • [ ] 完善组件文档
  • [ ] 添加组件示例
  • [ ] 优化组件API
  • [ ] 添加单元测试
  • [ ] 支持主题定制