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

vue2-usoft-datacanvas

v0.1.2

Published

一个基于Vue 2的数据看板设计器组件库。

Readme

Dashboard Designer

一个基于Vue 2的数据看板设计器组件库。

功能特性

  • 🎨 可视化拖拽设计
  • 📱 响应式布局支持
  • 🎯 组件属性配置
  • 🎪 事件系统支持
  • 📦 多格式打包输出

安装

npm install dashboard-designer
# 或
yarn add dashboard-designer

使用方法

CommonJS模块使用

// 导入CommonJS模块
const DashboardDesigner = require('dashboard-designer/lib/commonjs/dashboard-designer.common.js')
require('dashboard-designer/lib/commonjs/dashboard-designer.css')

// 或者使用ES6 import语法
import DashboardDesigner from 'dashboard-designer/lib/commonjs/dashboard-designer.common.js'
import 'dashboard-designer/lib/commonjs/dashboard-designer.css'

// 在Vue组件中使用
export default {
  components: {
    DashboardDesigner
  }
}

UMD模块

<script src="dashboard-designer/lib/umd/dashboard-designer.js"></script>
<link rel="stylesheet" href="dashboard-designer/lib/umd/dashboard-designer.css">

在Vue项目中使用

<template>
  <div>
    <DashboardDesigner 
      :component-instances="componentInstances"
      :registered-components="registeredComponents"
      @update-instance="handleUpdateInstance"
    />
  </div>
</template>

<script>
import DashboardDesigner from 'dashboard-designer'

export default {
  components: {
    DashboardDesigner
  },
  data() {
    return {
      componentInstances: [],
      registeredComponents: []
    }
  },
  methods: {
    handleUpdateInstance(instance) {
      // 处理组件实例更新
    }
  }
}
</script>

开发

安装依赖

npm install
# 或
yarn install

开发模式

npm run serve

构建组件库

# 构建所有格式
npm run build:lib

# 仅构建UMD格式
npm run build:lib:umd

# 仅构建CommonJS格式
npm run build:lib:commonjs

构建输出

构建后的文件将输出到 lib 目录:

lib/
├── commonjs/
│   ├── dashboard-designer.common.js
│   └── dashboard-designer.css
└── umd/
    ├── dashboard-designer.umd.js
    ├── dashboard-designer.umd.min.js
    └── dashboard-designer.css

API文档

Props

| 属性名 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | componentInstances | Array | [] | 组件实例列表 | | registeredComponents | Array | [] | 注册的组件配置 | | previewMode | Boolean | false | 预览模式 |

Events

| 事件名 | 参数 | 说明 | |--------|------|------| | update-instance | instance | 组件实例更新时触发 | | select-instance | instanceId | 选中组件时触发 | | delete-instance | instanceId | 删除组件时触发 |

许可证

MIT License