fix: 解决渐变组件预览无法更新的问题

This commit is contained in:
奔跑的面条 2022-08-30 12:18:15 +08:00
parent 199c6abcb1
commit 159a165457

View File

@ -10,7 +10,7 @@ import { PropType, toRefs, shallowReactive, watch } from 'vue'
import { CreateComponentType } from '@/packages/index.d'
import { useChartDataFetch } from '@/hooks'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import { option as configOption } from './config'
import { option as configOption } from './config'
const props = defineProps({
chartConfig: {
@ -26,11 +26,13 @@ const option = shallowReactive({
const { w, h } = toRefs(props.chartConfig.attr)
const { size, gradient } = toRefs(props.chartConfig.option)
watch(
() => props.chartConfig.option.dataset,
(newData: any) => {
option.dataset = newData
},
{
immediate: true
}
)