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

@xpyjs/gantt-vue

v0.0.1

Published

Vue wrapper for x-gantt

Readme

XGantt Vue 组件

基于 XGantt 核心的 Vue 3 组件封装。

安装

npm install @xpyjs/gantt-vue
# 或
pnpm add @xpyjs/gantt-vue

使用

全局注册

import { createApp } from 'vue'
import XGanttVue from '@xpyjs/gantt-vue'
import '@xpyjs/gantt-vue/style.css'

const app = createApp(App)
app.use(XGanttVue)

局部注册

<template>
  <XGanttChart
    :data="ganttData"
    :width="1200"
    :height="600"
    :table="tableConfig"
    primary-color="#1890ff"
    @move="onTaskMove"
    @select="onTaskSelect"
  />
</template>

<script setup lang="ts">
import { XGanttChart } from '@xpyjs/gantt-vue'
import '@xpyjs/gantt-vue/style.css'

const ganttData = ref([
  {
    id: '1',
    name: '任务1',
    startTime: '2024-01-01',
    endTime: '2024-01-15',
    progress: 80
  }
])

const tableConfig = {
  columns: [
    { field: 'name', label: '任务名称', width: 200 },
    { field: 'progress', label: '进度', width: 80 }
  ]
}

const onTaskMove = (moved) => {
  console.log('任务移动:', moved)
}

const onTaskSelect = (selected, checked, all) => {
  console.log('任务选择:', { selected, checked, all })
}
</script>

属性 (Props)

| 属性名 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | data | Array | [] | 甘特图数据 | | width | Number | undefined | 甘特图宽度 | | height | Number | undefined | 甘特图高度 | | primaryColor | String | "#eca710" | 主色调 | | dateFormat | String | "YYYY-MM-DD" | 日期格式 | | unit | String | "day" | 时间刻度 | | locale | String | "en" | 显示语言 | | fields | Object | {...} | 字段映射配置 | | table | Object | {...} | 表格配置 | | chart | Object | {...} | 图表配置 |

事件 (Events)

| 事件名 | 参数 | 说明 | |--------|------|------| | move | moved | 任务拖拽移动完成 | | select | selected, checked, all | 任务选择 | | click:row | event, row | 行点击 | | dblclick:row | event, row | 行双击 | | error | error | 错误事件 |

方法 (Methods)

| 方法名 | 参数 | 返回值 | 说明 | |--------|------|--------|------| | jumpTo | date? | boolean | 跳转到指定日期 | | getOptions | - | object | 获取甘特图选项 | | render | - | void | 重新渲染 | | getInstance | - | XGantt | 获取甘特图实例 |

开发

# 安装依赖
pnpm install

# 开发
pnpm dev

# 构建
pnpm build

许可证

MIT