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

yc-designer

v0.1.1

Published

基于Vue 3.5的可视化设计器组件库

Readme

YC Designer

基于 Vue 3.5 + TypeScript 5 + Vite 6 的可视化设计器组件库,支持拖拽式布局设计和表单设计。

特性

  • 📦 基于 Vue 3.5.x 和 TypeScript 5
  • 🔨 支持多种布局组件(栅格、网格、标签页、卡片等)
  • 📝 表单联动与条件显示
  • 🎨 支持多种选项数据来源(静态、字典、远程)
  • 📱 同时支持移动端和PC端
  • 📊 支持报表管理功能

安装

# npm
npm install yc-designer

# yarn
yarn add yc-designer

# pnpm
pnpm add yc-designer

使用方法

全局注册

// main.ts
import { createApp } from 'vue'
import App from './App.vue'
import YcDesigner from 'yc-designer'
import 'yc-designer/dist/style.css'

const app = createApp(App)
app.use(YcDesigner)
app.mount('#app')

按需引入

<script setup lang="ts">
import { GridLayout, FormDesigner } from 'yc-designer'
import 'yc-designer/dist/style.css'
</script>

<template>
  <GridLayout :columns="2" :gap="20">
    <FormDesigner 
      title="用户信息表单"
      :fields="formFields"
      :columns="1"
      v-model="formData"
      @submit="handleSubmit"
    />
  </GridLayout>
</template>

<script lang="ts">
import { ref, reactive } from 'vue'

// 表单字段定义
const formFields = [
  {
    name: 'username',
    label: '用户名',
    type: 'text',
    required: true,
    placeholder: '请输入用户名'
  },
  {
    name: 'gender',
    label: '性别',
    type: 'radio',
    options: [
      { label: '男', value: 'male' },
      { label: '女', value: 'female' }
    ]
  },
  {
    name: 'interests',
    label: '兴趣爱好',
    type: 'checkbox',
    options: [
      { label: '阅读', value: 'reading' },
      { label: '游泳', value: 'swimming' },
      { label: '编程', value: 'coding' }
    ],
    // 当性别为男时显示
    displayCondition: "gender === 'male'"
  }
]

// 表单数据
const formData = reactive({})

// 表单提交处理
const handleSubmit = (data) => {
  console.log('表单数据:', data)
}
</script>

组件文档

GridLayout 栅格布局

栅格布局组件,基于CSS Grid实现,用于页面布局。

属性

| 属性名 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | | columns | number | 12 | 列数 | | rows | number | 1 | 行数 | | gap | number | string | 10 | 单元格间距 | | columnWidth | string | '1fr' | 列宽 | | rowHeight | string | 'auto' | 行高 | | areas | string[] | - | 区域定义 |

FormDesigner 表单设计器

表单设计器组件,用于创建和渲染表单。

属性

| 属性名 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | | title | string | '表单设计器' | 表单标题 | | fields | FormField[] | [] | 表单字段定义 | | layout | 'horizontal' | 'vertical' | 'inline' | 'horizontal' | 表单布局 | | labelWidth | string | number | '120px' | 标签宽度 | | modelValue | Record<string, any> | {} | 表单数据 | | columns | number | 1 | 分栏数 |

事件

| 事件名 | 说明 | 回调参数 | | --- | --- | --- | | update:modelValue | 表单数据变更 | formData: Record<string, any> | | submit | 表单提交 | formData: Record<string, any> | | reset | 表单重置 | - |

开发与发布

开发

# 安装依赖
pnpm install

# 开发模式
pnpm run dev

# 构建库
pnpm run build:lib

发布

发布前请确保已登录相应的 npm 账号:

# 登录国际 npm (npmjs.org)
pnpm run login:npm

# 登录国内镜像 (npmmirror.com)
pnpm run login:cnpm

# 发布到国际 npm
pnpm run publish

# 发布到国内镜像
pnpm run publish:cn

许可证

MIT