fix: 第一个元素动画为被动触发时,进入放映后自动执行(#273)

This commit is contained in:
zxc 2024-06-12 22:10:54 +08:00
parent 0a2cc37f81
commit 929ca28f1b

View File

@ -70,6 +70,14 @@ export default () => {
}
}
onMounted(() => {
const firstAnimations = formatedAnimations.value[0]
if (firstAnimations && firstAnimations.animations.length) {
const autoExecFirstAnimations = firstAnimations.animations.every(item => item.trigger === 'auto' || item.trigger === 'meantime')
if (autoExecFirstAnimations) runAnimation()
}
})
// 撤销元素动画,除了将索引前移外,还需要清除动画状态
const revokeAnimation = () => {
animationIndex.value -= 1