@bryntum/gantt-react

中文文档
7.3.8发布于 2026/10/28CommercialTypeScriptESM + CJS零依赖近 30 天下载 3841

Bryntum Gant JavaScript 组件的回放包装

中文使用文档
文档目录13 节
  1. 版本要求
  2. 软件包内容
  3. 安装
  4. 反应收发器
  5. 组件包(需要)
  6. 尝试 Bryntum 在线演示
  7. 快速启动
  8. 融合指南
  9. 包装器
  10. 特征
  11. 探索所有Bryntum 产品
  12. 在线参考资料
  13. 许可证和版权


Bryntum logo       React


布林图姆·甘特反应包装

这个软件包包含一个包裹,将Bryntum Gantt封装起来,并变成反应组件,曝光 配置选项、属性、特性和事件.

版本要求

  • 反应 : 18 或更高
  • 类型脚本 : 4.2 或更高
  • 维特 5 或更高

软件包内容

路径说明
lib/反应包装组件(BryntumGantt等)
src/原始源文件

安装

反应收发器

npm install @bryntum/gantt-react@latest

组件包(需要)

npm install @bryntum/gantt@latest

尝试 Bryntum 在线演示

快速启动

替换您的 App.tsx 含以下内容:

import { FunctionComponent, useRef } from 'react';
import { BryntumGantt } from '@bryntum/gantt-react';
import { ganttProps } from './Config';
import './App.scss';

const App: FunctionComponent = () => {
    const gantt = useRef<BryntumGantt>(null);

    return <BryntumGantt ref={gantt} {...ganttProps} />;
};

export default App;

创建一个 GanttConfig.ts 文档中 src/ 包含以下内容的目录 :

import { BryntumGanttProps } from '@bryntum/gantt-react';

const ganttProps : BryntumGanttProps = {
    startDate  : new Date(2026, 0, 1),
    endDate    : new Date(2026, 2, 1),
    columns    : [{ type : 'name', field : 'name', width : 250 }],
    viewPreset : 'weekAndDayLetter',
    barMargin  : 10,

    project : {
        transport : {
            load : {
                url : 'data.json'
            }
        },
        autoLoad           : true,
        // Automatically introduces a `startnoearlier` constraint for tasks that (a) have no predecessors, (b) do not use
        // constraints and (c) aren't `manuallyScheduled`
        autoSetConstraints : true
    }
};

export { ganttProps };
创建样本数据( 单击以扩展)

创建一个 public/data/data.json 例如,文件并添加以下JSON数据:

{
  "success": "true",
  "tasks": {
    "rows": [
      {
        "id": 1,
        "name": "Documentation Project",
        "expanded": true,
        "children": [
          {
            "id": 2,
            "name": "Preparation",
            "expanded": true,
            "children": [
              { "id": 6, "name": "Proof-read docs", "startDate": "2026-01-02", "endDate": "2026-01-09" },
              { "id": 3, "name": "Release docs",    "startDate": "2026-01-09", "endDate": "2026-01-10" }
            ]
          },
          {
            "id": 4,
            "name": "Development",
            "expanded": true,
            "children": [
              { "id": 7, "name": "Write API docs",  "startDate": "2026-01-05", "endDate": "2026-01-12" },
              { "id": 8, "name": "Write tutorials", "startDate": "2026-01-10", "endDate": "2026-01-16" },
              { "id": 9, "name": "Create examples", "startDate": "2026-01-12", "endDate": "2026-01-18" }
            ]
          },
          {
            "id": 5,
            "name": "Review & Release",
            "expanded": true,
            "children": [
              { "id": 10, "name": "Team review",     "startDate": "2026-01-18", "endDate": "2026-01-20" },
              { "id": 11, "name": "Final approval",  "startDate": "2026-01-20", "endDate": "2026-01-21" },
              { "id": 12, "name": "Public release",  "startDate": "2026-01-22", "endDate": "2026-01-22" }
            ]
          }
        ]
      }
    ]
  },
  "dependencies": {
    "rows": [
      { "fromTask": 6,  "toTask": 3  },
      { "fromTask": 7,  "toTask": 8  },
      { "fromTask": 8,  "toTask": 9  },
      { "fromTask": 9,  "toTask": 10 },
      { "fromTask": 10, "toTask": 11 },
      { "fromTask": 11, "toTask": 12 }
    ]
  }
}

这是Bryntum甘特将使用的数据.

最后,在你的风格上加一些 App.css 或者说 index.css数字 :

/* FontAwesome is used for icons */
@import '@bryntum/gantt/fontawesome/css/fontawesome.css';
@import '@bryntum/gantt/fontawesome/css/solid.css';
/* Structural CSS */
@import "@bryntum/gantt/gantt.css";
/* Bryntum theme of your choice */
@import "@bryntum/gantt/svalbard-light.css";

融合指南

关于安装和使用此软件包的详情,请参见 反应整合指南。 。 。 .

包装器

React spackers将Bryntum组件封装为本土React组件,暴露出所有配置选项, 属性,特征,和事件通过React-familiar模式如道具和回调.

访问 包装文件 完整清单 包装组件.

特征

地物是扩展Bryntum Gantt功能的可选模块. 每个特性后缀为 Feature 财务报告和审定财务报表 可以通过标准反应道具启用并配置.

访问 特征文件 完整清单 特性及其配置选项.

探索所有Bryntum 产品

探索我们综合收集的演示文稿:

产品JavaScript
Java 脚本
React
反应
Vue
阴道
Angular
角质
网格网格 JavaScript 演示网格反应演示网格 Vue 演示网格角演示
调度器JavaScript 演示调度器反应演示调度员 Vue 演示调度器
调度器Pro调度器 Pro JavaScript 演示排程器 Pro React 演示调度器 Pro Vue 演示排程器 Pro Angular 演示
甘特语甘特Java脚本演示甘特反应演示Gantt Vue 演示Gantt 角力演示
日历日历 JavaScript 演示日历反应演示日历 Vue 演示日历角演示
任务栏任务板 JavaScript 演示任务板反应演示任务板 Vue 演示任务板角演示

在线参考资料

这个包装器依赖于Bryntum Gantt,它是商业软件,需要付费许可证. 请访问 Bryntum Gantt 结束用户许可证 执照的全文.

版权所有:2009-2026年,Bryntum 版权所有.

版本与发布记录

@bryntum/gantt-react 共发布 17 个版本,首次发布于 2026/01/22;过去 12 个月发布了 17 个版本。

版本发布日期距今
7.3.8latest2026/10/2811 天前
7.3.72026/09/241 个月前
7.3.62026/09/111 个月前
7.3.52026/08/212 个月前
7.3.42026/07/223 个月前
7.3.32026/06/254 个月前

关于 @bryntum/gantt-react 的常见问题

@bryntum/gantt-react 是什么?

Bryntum Gant JavaScript 组件的回放包装

如何安装 @bryntum/gantt-react?

在项目目录运行 npm install @bryntum/gantt-react,或使用 pnpm add / yarn add / bun add。

@bryntum/gantt-react 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@bryntum/gantt-react 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@bryntum/gantt-react 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=0.10.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@bryntum/gantt-react 可以商用吗?

@bryntum/gantt-react 使用 Commercial 许可。声明的许可为 Commercial,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@bryntum/gantt-react 的下载量有多少?

根据 npm 官方下载统计,@bryntum/gantt-react 在 2026/10/09 – 2026/11/07 这 30 天内被下载 3,841 次,日均约 128 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bryntum/gantt-react 还在维护吗?

最新版本 7.3.8 发布于 2026/10/28(11 天前);至今共发布 17 个版本,其中过去 12 个月发布了 17 个;首次发布于 2026/01/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。