mirror of
https://gitee.com/dromara/go-view.git
synced 2025-10-15 06:52: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 { useChartDataFetch } from '@/hooks'
|
||||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||||
import { option as configOption } from './config'
|
import { option as configOption } from './config'
|
||||||
import cloneDeep from 'lodash/cloneDeep'
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
chartConfig: {
|
chartConfig: {
|
||||||
@ -46,14 +45,12 @@ const option = shallowReactive({
|
|||||||
|
|
||||||
let textAutoBox = ref()
|
let textAutoBox = ref()
|
||||||
let showDown = false
|
let showDown = false
|
||||||
let relanimation = cloneDeep(animation)
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (textAutoBox.value.clientHeight > props.chartConfig.attr.h) {
|
if (textAutoBox.value.clientHeight > props.chartConfig.attr.h) {
|
||||||
showDown = true
|
showDown = true
|
||||||
}
|
}
|
||||||
if (!showDown) {
|
if (!showDown) {
|
||||||
nextTick(() => {textAutoBox.value.style.animationDuration = '0s'})
|
nextTick(() => {textAutoBox.value.style.animationDuration = '0s'})
|
||||||
relanimation.value = 0
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -69,14 +66,12 @@ watch(
|
|||||||
showDown = true
|
showDown = true
|
||||||
}
|
}
|
||||||
if (!showDown) {
|
if (!showDown) {
|
||||||
relanimation.value = 0
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
textAutoBox.value.style.animationDuration = `${relanimation.value}s`
|
textAutoBox.value.style.animationDuration = `0s`
|
||||||
}, 200);
|
}, 200);
|
||||||
} else {
|
} else {
|
||||||
relanimation.value = animation.value
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
textAutoBox.value.style.animationDuration = `${relanimation.value}s`
|
textAutoBox.value.style.animationDuration = `${animation.value}s`
|
||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -87,16 +82,6 @@ watch(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
watch(
|
|
||||||
() => animation,
|
|
||||||
(newData: any) => {
|
|
||||||
relanimation = newData
|
|
||||||
},
|
|
||||||
{
|
|
||||||
immediate: true
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
// 预览更新
|
// 预览更新
|
||||||
useChartDataFetch(props.chartConfig, useChartEditStore, (newData: string) => {
|
useChartDataFetch(props.chartConfig, useChartEditStore, (newData: string) => {
|
||||||
option.dataset = newData
|
option.dataset = newData
|
||||||
@ -123,7 +108,7 @@ useChartDataFetch(props.chartConfig, useChartEditStore, (newData: string) => {
|
|||||||
background-color: v-bind('backgroundColor');
|
background-color: v-bind('backgroundColor');
|
||||||
.innerActive {
|
.innerActive {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
animation: slide v-bind('relanimation + "s"') linear infinite;
|
animation: slide v-bind('animation + "s"') linear infinite;
|
||||||
#textAutoBox {
|
#textAutoBox {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user