import { ref } from 'vue'; import { getDictTypeData } from '@/api'; import type { DictCode } from '@/constants'; import type { DictValue } from '@/types'; export const useDictData = (dictCode: DictCode) => { const dictData = ref([]); const getDictData = async () => { const data = await getDictTypeData({ dictCode, }); if (data.length) { dictData.value = data[0].dictTypeDataList; } }; return { dictData, getDictData, }; };