Skip to content
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

useTrackAnimation hooks 若 options.delay > 0 则导致 status 更新失败 #55

Closed
Hi-Alan opened this issue Nov 9, 2023 · 1 comment

Comments

@Hi-Alan
Copy link

Hi-Alan commented Nov 9, 2023

代码

const { setPath, start, cancel, stop, proceed, status } = useTrackAnimation(map, {
  duration: 30000,
  delay: 300, // >0 
  tilt: 55,
  overallView: true,
  zoom: 14,
})

watch(status, (newVal, oldVal) => {
  // 不会调用
  console.log(oldVal ,'->', newVal)
})

错误提示

useTrackAnimation.js:40 Uncaught TypeError: Cannot read properties of undefined (reading 'addEventListener')
    at useTrackAnimation.js:40:35

原因
instance.start() 之后, 会延迟 options.delay 之后初始化 instance._viewAni

@yue1123
Copy link
Owner

yue1123 commented Nov 10, 2023

确实存在这个问题,下个patch版本修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants