Comments (3)
@dazhaocode 数据还未请求回来的时候,为什么会用到这里?这里只有数据更新时才会调用。可否给一个用例?
from gantt.
@jeremyjone
sure! open this url :https://codesandbox.io/s/serene-poitras-3r8w8h
code is here: https://github.com/dazhaocode/jzgantt-case.git
from gantt.
@dazhaocode 我看到了。
原因:您的数据中没有 children
键名。
解决方案:请确保数据中 children
、index
、startDate
以及 endDate
四个属性的存在(其中后三项可以通过传值修改键名)。为了确保所有数据的统一,在定义数据类型的同时,您就应该定义它:
interface IData {
id: number;
name: string;
startDate: string;
endDate: string;
children: Array<IData>;
}
当数据类型正确的时候,所有数据都会正确显示。
===
简要说明:为了保证数据的统一,以及每一层数据的准确性,我们需要确保数据中至少4个属性的存在:
index
确保数据的唯一性,它应对于所有数据全局唯一的。通过 data-index 替换children
可以使数据层级嵌套,如果没有子集,只需要置空即可startDate
可以在甘特图中正确渲染数据的起始日期。通过 start-key 替换endDate
可以在甘特图中正确渲染数据的截止日期。通过 end-key 替换
详细内容,请见 文档 - data
from gantt.
Related Issues (20)
- [FEATURE] HOT 1
- [BUG]v-for的XGanttColumn 渲染不出来
- 你好,请问一下可以在vue2上支持vue3的滑块链接吗 HOT 1
- [BUG] 按照文档走报错 无法进入页面 HOT 3
- [BUG] 重新从后端获取数据时,二次滑动组件渲染有问题 HOT 1
- [BUG] 超过5个之后就无法渲染了 HOT 4
- [BUG] 按周展示时,比如第14周跨了3月和4月,4月也应该包含14周,而不是从15周开始 HOT 2
- [FEATURE] 希望能有属性支持控制甘特图的显示隐藏以及甘特图左侧的显示隐藏 HOT 1
- [BUG] HOT 1
- [FEATURE]是否可以单条数据上有多个任务? HOT 1
- [FEATURE]能否自定义甘特图的显示范围 HOT 1
- 请问支持一行多个滑块吗? HOT 1
- [BUG] HOT 9
- 你好,请问能不能提供一个给行和列自定义class的方法[FEATURE] HOT 4
- [BUG] I create startDate and endDate in rowtable, but when i change data in table, data not update, therefor data in gantt is old data HOT 5
- 更新x-gantt的data数据后,如果新数据的时间范围比上一条的数据的时间范围小,则时间轴仍然显示为上一次的时间范围[BUG] HOT 1
- [BUG]DEMO里面的组合式写法,表格全部是空,且目前我运用在项目里 也出现了表格渲染不出来的问题 HOT 8
- 添加ellipsis属性之后 文字超出只显示了省略号, 期待能支持鼠标滑过显示全量文字信息 HOT 1
- 如果数据列表日期为空,那么渲染为报错,为空我传的null[BUG] HOT 6
- 进度条跟最终日期差一天[BUG] HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gantt.