This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
import { computed } from 'vue';
import { useOptionsStore } from '@/stores/modules/options';
import type { DictCustom } from '@/api/types/system/dict';
/**
* 自定义 Hook,用于从 store 中获取字典选项
* @param dictName 字典名称
* @returns 返回字典选项
*/
export const useDictOptions = (dictName: string) => {
const optionsStore = useOptionsStore();
return computed<DictCustom[]>(() => optionsStore.getDictOptions(dictName) || []);
};