From 254bb0c7c30d772584ab6fab82afcbe0e6789eab Mon Sep 17 00:00:00 2001 From: linmingqi <2320447654@qq.com> Date: Thu, 30 Nov 2023 10:38:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0=E5=8F=AF=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E5=85=A8=E9=83=A8=E5=85=83=E7=B4=A0=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Editor/Toolbar/ElementAnimationPanel.vue | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/views/Editor/Toolbar/ElementAnimationPanel.vue b/src/views/Editor/Toolbar/ElementAnimationPanel.vue index 69220c53..4de5cabd 100644 --- a/src/views/Editor/Toolbar/ElementAnimationPanel.vue +++ b/src/views/Editor/Toolbar/ElementAnimationPanel.vue @@ -107,6 +107,9 @@ + @@ -171,7 +174,7 @@ const tabs: TabItem[] = [ { key: 'attention', label: '强调', color: '#e8b76a' }, ] const activeTab = ref('in') - +const animateIn = ref(false) watch(() => handleElementId.value, () => { animationPoolVisible.value = false }) @@ -247,6 +250,17 @@ const runAnimation = (elId: string, effect: string, duration: number) => { elRef.addEventListener('animationend', handleAnimationEnd, { once: true }) } } +// 执行所有动画预览 +const runAllAnimation = async () => { + animateIn.value = !animateIn.value + for (let i = 0; i < animationSequence.value.length; i++) { + if (!animateIn.value) break + const item = animationSequence.value[i] + if (item.index !== 1 && item.trigger !== 'meantime') await new Promise(resolve => setTimeout(resolve, item.duration + 100)) + runAnimation(item.elId, item.effect, item.duration) + if (i === animationSequence.value.length - 1) animateIn.value = false + } +} // 修改元素动画持续时间 const updateElementAnimationDuration = (id: string, duration: number) => {