-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问一下怎么让中间的线移动,就是时间走的时候不移动时间轴 #14
Comments
不支持哈,可以自己二次开发 |
好的,谢谢啦 |
这个问题你解决了吗 兄弟 @LoveCodingOnGithub |
@gitboyzcf 解决了,把源码改了一下 |
代码可以分享一下么 |
@a0124569873 我这边是移动时间轴中间线不走 根据起始时间和结束时间时间段 利用定时器为时间轴增加时间 使用时间轴暴露出的setTime方法设置 let timer = null
let interval = 1000 // 间隔时间
let startTime = 0 // 起始时间
let endTime = 0 // 结束时间
let current = 0
// 定义定时器函数
const incrementTime = () => {
if (startTime >= endTime) {
if (current >= timeSegments.value.length - 1) {
clearInterval(timer) // 结束定时器
console.log('已经到达结束时间')
return
}
current += 1
startTime = +timeSegments.value[current].beginTime
endTime = +timeSegments.value[current].endTime
clearInterval(timer)
timer = setInterval(incrementTime, interval)
} else {
// 执行递增操作(示例中是每秒加1秒)
startTime += interval
TimeLineRef.value.setTime(startTime)
}
} |
@LoveCodingOnGithub 按照你源代码里面的方法,改变this.time之后中间的线还是在中间,刻度会自动移动 |
有完整的代码示例吗? 按照上面发的 没有效果 |
|
@LoveCodingOnGithub 感谢,已经按照之前发的实现了,没效果是因为重置刻度线的问题,代码注释掉就可以了 |
@SnowBeatRain 好的,对你有帮助就行 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: