- import { computed } from 'vue'
- import { useAppStore } from '@/stores/app'
- import type { DictItem } from '@/utils/global'
- export function useDict(dictName: string) {
- const appStore = useAppStore()
- const dict = computed<DictItem[]>(() => appStore.dict[dictName] || [])
- return { dict }
- }
|