From e34d928d4a38f0ab639401708d8b74b203e14722 Mon Sep 17 00:00:00 2001 From: nowhy-char <2531677517@qq.com> Date: Fri, 18 Nov 2022 11:08:12 +0800 Subject: [PATCH] fix: small change --- .../Informations/Texts/TextAuto/index.vue | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/packages/components/Informations/Texts/TextAuto/index.vue b/src/packages/components/Informations/Texts/TextAuto/index.vue index 504451f1..9f00ae60 100644 --- a/src/packages/components/Informations/Texts/TextAuto/index.vue +++ b/src/packages/components/Informations/Texts/TextAuto/index.vue @@ -14,7 +14,6 @@ import { CreateComponentType } from '@/packages/index.d' import { useChartDataFetch } from '@/hooks' import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' import { option as configOption } from './config' -import cloneDeep from 'lodash/cloneDeep' const props = defineProps({ chartConfig: { @@ -46,14 +45,12 @@ const option = shallowReactive({ let textAutoBox = ref() let showDown = false -let relanimation = cloneDeep(animation) onMounted(() => { if (textAutoBox.value.clientHeight > props.chartConfig.attr.h) { showDown = true } if (!showDown) { nextTick(() => {textAutoBox.value.style.animationDuration = '0s'}) - relanimation.value = 0 } }) @@ -69,14 +66,12 @@ watch( showDown = true } if (!showDown) { - relanimation.value = 0 setTimeout(() => { - textAutoBox.value.style.animationDuration = `${relanimation.value}s` + textAutoBox.value.style.animationDuration = `0s` }, 200); } else { - relanimation.value = animation.value setTimeout(() => { - textAutoBox.value.style.animationDuration = `${relanimation.value}s` + textAutoBox.value.style.animationDuration = `${animation.value}s` }, 200); } }) @@ -87,16 +82,6 @@ watch( } ) -watch( - () => animation, - (newData: any) => { - relanimation = newData - }, - { - immediate: true - } -) - // 预览更新 useChartDataFetch(props.chartConfig, useChartEditStore, (newData: string) => { option.dataset = newData @@ -123,7 +108,7 @@ useChartDataFetch(props.chartConfig, useChartEditStore, (newData: string) => { background-color: v-bind('backgroundColor'); .innerActive { width: 100%; - animation: slide v-bind('relanimation + "s"') linear infinite; + animation: slide v-bind('animation + "s"') linear infinite; #textAutoBox { display: inline-block; width: 100%;