vue-ganttastic
vue-ganttastic copied to clipboard
The feature has been added in release 2.3.1.
The feature has been added in release 2.3.1.
Originally posted by @zunnzunn in https://github.com/zunnzunn/vue-ganttastic/issues/92#issuecomment-2008139894
current-time is static, I think it should be real-time
you say the moment marker should move dynamically over time?
you say the moment marker should move dynamically over time?
yes
I tried this on the feature and hoped it would work like that, but apparently, that's not what happened.
const xDist = computed(() => {
const format = dateFormat.value || "YYYY-MM-DD HH:mm"
return mapTimeToPosition(dayjs(currentMoment.value, format).format(format))
})
I ran some tests and could only achieve it using the set interval
function, and I don't think it's the right way because it can decrease efficiency and processing power.
const xDist = setInterval(() => {
const format = dateFormat.value || "YYYY-MM-DD HH:mm"
return mapTimeToPosition(dayjs(currentMoment.value, format).format(format))
}, 1)
I leave it open here for future improvements for anyone who wants to venture, in my case, my knowledge was limited to this haha
currentMoment
I created a PR, can you see if this solution is feasible?
https://github.com/zunnzunn/vue-ganttastic/pull/114