Parcourir la source

fix: 处理ts类型错误

奔跑的面条 il y a 3 ans
Parent
commit
774c005306

+ 2 - 2
src/views/chart/ContentConfigurations/components/hooks/useTargetData.hook.ts

@@ -1,11 +1,11 @@
 import { computed, Ref } from 'vue'
-import { CreateComponentType } from '@/packages/index.d'
+import { CreateComponentType, CreateComponentGroupType } from '@/packages/index.d'
 import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
 
 // 获取当前对象数据
 export const useTargetData = () => {
   const chartEditStore = useChartEditStore()
-  const targetData: Ref<CreateComponentType> = computed(() => {
+  const targetData: Ref<CreateComponentType | CreateComponentGroupType> = computed(() => {
     const list = chartEditStore.getComponentList
     const targetIndex = chartEditStore.fetchTargetIndex()
     return list[targetIndex]