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 🙏

© 2024 – Pkg Stats / Ryan Hefner

easygantt

v1.1.5

Published

<img src="https://github.com/chenjing0823/easy-gantt/blob/master/docs/.vuepress/public/logo.png" alt="Easy Gantt">

Downloads

9

Readme

homepage

在线文档:组件使用说明

动手试试

在线demo,动手试试。 codesanbox

使用

npm i easygantt

main.js 内引入依赖

import EasyGantt from 'easygantt'
import 'easygantt/dist/easyGantt.css'


Vue.use(EasyGantt)

默认用法

  • 传参 ganttHead, 用于渲染甘特图的时间
  • 传参 ganttData, 用于渲染甘特图的数据

数据说明: ganttData 内的 data 中, start表示开始时间刻度 end 表示结束时间刻度 操作说明: this.$refs.easygantt.renderGantBlock()用于更新渲染甘特图

<template>
  <div id="app">
    <easy-gantt
      ref="easygantt"
      :sort="sort"
      :ganttHead="ganttHead"
      :ganttData="ganttData"
      @seletcData="seletcData"
      ></easy-gantt>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        sort: {
          row: "时间",
          column: "成员"
        },
        ganttHead: [
          { prop: 'wen', label: '07-13 周三' },
          { prop: 'thu', label: '07-14 周四' },
          { prop: 'fri', label: '07-15 周五' },
          { prop: 'sat', label: '07-16 周六' },
          { prop: 'sun', label: '07-17 周天' },
          { prop: 'mon', label: '07-18 周一' },
          { prop: 'tue', label: '07-19 周二' }
        ],
        ganttData: [
          {
            id: '1',
            title: '张三',
            order: 1,
            data: [
              { id: '1-1', start: 'wen', end: 'wen', name: '周三 拜访我大哥地方', state: 'success' },
              { id: '1-2',  start: 'fri', end: 'sat', name: '周五-周六 隐藏三条以上数据1', state: 'success' },
              { id: '1-3',  start: 'fri', end: 'fri', name: '周五 隐藏三条以上数据2' },
              { id: '1-4',  start: 'fri', end: 'sat', name: '周五-周六 隐藏三3,通过limit属性控制,默认为2' }
            ]
          },
          {
            id: '2',
            title: '李四',
            order: 2,
            data: [
              { id: '2-1',  start: 'wen', end: 'wen', name: '12:00-13:00 工单名称7' },
            ]
          },
          {
            id: '3',
            title: '王五',
            order: 3,
            data: [
              { id: '3-1',  start: 'thu', end: 'thu', name: '12:00-13:00 工单名称9' }
            ]
          }
        ]
      }
    },
    methods: {
      seletcData (data) {
        console.log(data)
        const { rowid, start, end } = data

        const rowindex = this.ganttData.findIndex(res => res.id === rowid)
        // 添加数据
        this.ganttData[rowindex].data.push(
          { start: start, end: end, name: '12:00-13:00 手动添加' })
        this.$refs.easygantt.renderGantBlock() // 触发渲染
      }
    }
  }
</script>