fix: 柱状图传入错误数据后展示问题

This commit is contained in:
headmasterZhao 2023-04-04 08:46:56 +08:00
parent 0f61ee728b
commit 93f398d5a7

View File

@ -52,6 +52,7 @@ watch(
() => props.chartConfig.option.dataset,
(newData: { dimensions: any }, oldData) => {
try {
debugger
if (!isObject(newData) || !('dimensions' in newData)) return
if (Array.isArray(newData?.dimensions)) {
const seriesArr = []
@ -69,7 +70,7 @@ watch(
for (let i = 0; i < dimensionsGap; i++) {
seriesArr.push(cloneDeep(seriesItem))
}
props.chartConfig.option.series = [...seriesArr]
props.chartConfig.option.series.push(...seriesArr)
}
replaceMergeArr.value = ['series']
nextTick(() => {