useTopicSubjects.js 446 B

1234567891011121314
  1. import {onMounted, ref} from 'vue'
  2. import {useCacheStore} from "@/hooks/useCacheStore";
  3. import {cacheActions} from "@/hooks/defineCacheActions";
  4. export const useTopicSubjects = function () {
  5. const subjects = ref([])
  6. const {dispatchCache} = useCacheStore()
  7. onMounted(async () => {
  8. subjects.value = await dispatchCache(cacheActions.getSubjectList)
  9. })
  10. return {subjects, keyName: 'subjectName', keyValue: 'subjectId'}
  11. }