fix: 处理ts类型错误

This commit is contained in:
奔跑的面条 2022-08-12 20:46:17 +08:00
parent e380ead651
commit 5fba293245

View File

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