mirror of
https://gitee.com/dromara/go-view.git
synced 2025-10-14 22:42:10 +08:00
fix: small change
This commit is contained in:
parent
cc80bb0c09
commit
e34d928d4a
@ -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%;
|
||||
|
Loading…
x
Reference in New Issue
Block a user