Comments (12)
timelines | ❌ | array | -- | 显示标记时间,有特殊格式 [{time:'2019-01-11 18:18:18',color:'#00000'}] |
---|
这个不能满足要求吗?
from vue-gantt-chart.
我改的是源码。。。已经加了一条23:59:59了,但只是当天的。。。能不能让动态的时间轴每天都加一条
from vue-gantt-chart.
zeroTime: dayjs().endOf("day").toString(),这样能获取到当天的。如何让每天都加一条上去,烦请指教
from vue-gantt-chart.
你传递开始结束时间的时候,顺便用computed 计算出每天的时间线可以吗
from vue-gantt-chart.
不行,烦请明示怎么操作。
我按照currentTime写了个zerotime的组件,然后我在gantt.vue里面computed,好像没起效
from vue-gantt-chart.
没起效是什么情况?用devtools打印出计算出的每天的时间线看看正不正确。然后在看传递的到对应子组件的正不正确。
from vue-gantt-chart.
在gantt.vue里面写computed是么?我写了一条:
zeroTime () {
//计算出每天的时间线
const { scale, start } = this;
const zeroTime = getBeginTimeOfTimeLine(start, scale);
return zeroTime;
},
gantt里面组件这么写:
然后如何传递给对应的子组件,用props?还是用provide?
from vue-gantt-chart.
明显不太对吧。你这样的zeroTime 是数组吗?不应该是
const { scale, start,end } = this;
const endOfDays=[]
while(start<end){
endOfDays.push(start.endOf('day')
start.add(1,'day')
}
return endOfDays
大概这么个意思
from vue-gantt-chart.
嗯,好的,谢谢大神,这么加可能会很卡,我再看下吧,谢谢指导。
from vue-gantt-chart.
目前暂时只加载两周的时间线
已经通过计算得出zeroTime,并通过prop传送到zeroTime组件里,下一步是把这个数组里面的每一条数据渲染出来线,我按照currentTime组件的写法另写了一个markline组件给zeroTime专用,通过循环想让他一直执行到数组结束为止,如下:
currentTime组件的markline写法是:return this.getPositonOffset(this.timeConfig.time);
然后我另写一个markline是这么写:
for (let i = 0; i < this.timeConfig.time.length; i++) {
let position = this.getPositonOffset(this.timeConfig.time[i]);
if (position) {
return position;
}
return position;
}
为什么只渲染了一条数据,是不是还有什么地方没弄好?
这么写也没效果
return this.timeConfig.time.map((item) => {
return this.getPositonOffset(item);
});
from vue-gantt-chart.
markline 一次只能渲染一条是没有问题的。不应该是v-for 循环渲染多条markline吗?
from vue-gantt-chart.
解决了。。。谢谢大神指导
from vue-gantt-chart.
Related Issues (20)
- 请问如何根据自定义的data内容,渲染出不同高度的left-bar-items? HOT 1
- 左侧数据遍历之后,发现上下滚动没同步数据,会出现白板 HOT 6
- 使用Vue3+cdn报window.Vue.use is not a function错误 HOT 3
- timeline下面一行是天,上面一行是月份能处理吗? HOT 2
- 想要隐藏左侧要怎么设置? HOT 1
- 请问 scale 能设置 年 月 季度的秒数吗? HOT 5
- demo里markLine的插槽没有生效,自己使用也是这样 HOT 1
- 滚动到最下面的时候,最后一行block内容只显示一半的问题 HOT 4
- 最开始时间块被遮挡 HOT 1
- 滚动的时候 y轴数据与x轴数据不对应,可以确保在滚动过程中y轴和x轴数据是正确的。请问下这种情况该怎么分析处理 HOT 1
- 我本地跑的那个Demo性能怎么没有你的那个demo性能好,是有什么优化吗 HOT 1
- markline怎么使用? HOT 2
- 支持不了vue3 HOT 2
- vue3支持吗?我在vue3里面运行会报错 HOT 1
- 开始/结束时间会随着屏幕宽度变化问题 HOT 2
- 关于性能优化问题 HOT 2
- 通过轮询不断更新datas的值,网页内存一直飙升直到崩溃 HOT 1
- 空的单元格不支持点击事件? HOT 3
- 左侧如何添加多列 HOT 3
- 是否支持Vue3 HOT 2
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 vue-gantt-chart.