import { reactive, toRefs } from 'vue';
import { CommonStore } from '@/stores/common';

export const useDict = (...keys: any) => {
  const data = reactive<any>({});
  keys.forEach((key: any) => {
    if (CommonStore().dictData[key]) {
      data[key] = CommonStore().dictData[key];
    }
  });
  const result = toRefs(data);

  return {
    ...result,
  };
};
