V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
50vip
V2EX  ›  程序员

封装一个开源的甘特图 react 组件

  •  
  •   50vip · 2017-02-15 12:14:36 +08:00 · 5599 次点击
    这是一个创建于 2598 天前的主题,其中的信息可能已经有所发展或是发生改变。

    github 地址:https://github.com/hustcc/gantt-for-react

    示例地址:http://git.hust.cc/gantt-for-react

    因为目前项目中,需要一个查看当前正在做的所有任务,利用甘特图来显示的一个非常不错的做法。但是 github 上已有的 react 甘特图组件太丑了。所以自己封装了一个。目前使用情况良好。

    使用很简单:

    import React from 'react';
    import ReactGantt from 'gantt-for-react';
    
    <ReactGantt 
        tasks={this.getTasks()} 
        viewMode={this.state.viewMode}
    
        onClick={this._func} 
        onDateChange={this._func}
        onProgressChange={this._func}
        onViewChange={this._func} 
        customPopupHtml={this._html_func} />
    
    

    原始的甘特图库是 https://github.com/frappe/gantt,实用配置文档可以直接参考这个即可。

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   945 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 21:04 · PVG 05:04 · LAX 14:04 · JFK 17:04
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.