fix(图表): 修复样式中配色方案不生效的问题

This commit is contained in:
ulleo 2024-10-23 18:31:54 +08:00
parent c2893522a5
commit a095ed5575

View File

@ -172,7 +172,7 @@ const changeSeriesColor = () => {
}) })
if (changed) { if (changed) {
state.value.basicStyleForm[seriesColorName.value] = cloneDeep(seriesColorState.seriesColor) state.value.basicStyleForm[seriesColorName.value] = cloneDeep(seriesColorState.seriesColor)
changeBasicStyle('seriesColor') changeBasicStyle(seriesColorName.value)
} }
} }
watch( watch(
@ -230,10 +230,13 @@ const changeColorOption = (option?) => {
c.color = items[0].colors[i % length] c.color = items[0].colors[i % length]
}) })
changeBasicStyle() changeBasicStyle()
setupSeriesColor()
} }
} }
const resetCustomColor = () => { const resetCustomColor = () => {
changeColorOption() state.value.basicStyleForm[seriesColorName.value] = []
changeBasicStyle(seriesColorName.value)
setupSeriesColor()
} }
const switchColorCase = () => { const switchColorCase = () => {
@ -264,7 +267,7 @@ const switchColor = (index, c) => {
customColorPickerRef.value?.show() customColorPickerRef.value?.show()
} }
function changeBasicStyle(prop = 'colors') { function changeBasicStyle(prop = colorsName.value) {
emits('changeBasicStyle', prop) emits('changeBasicStyle', prop)
} }