浏览代码

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

奔跑的面条 3 年之前
父节点
当前提交
b512328a70
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/packages/components/Informations/Texts/TextGradient/index.vue

+ 4 - 2
src/packages/components/Informations/Texts/TextGradient/index.vue

@@ -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
   }
 )