카테고리 목록 불러오기 수정

This commit is contained in:
yoon 2025-02-10 16:10:28 +09:00
parent 8fcc702d9b
commit 3cb3281a86

View File

@ -69,6 +69,7 @@
import DictCard from '@/components/wordDict/DictCard.vue'; import DictCard from '@/components/wordDict/DictCard.vue';
import DictWrite from '@/components/wordDict/DictWrite.vue'; import DictWrite from '@/components/wordDict/DictWrite.vue';
import DictAlphabetFilter from '@/components/wordDict/DictAlphabetFilter.vue'; import DictAlphabetFilter from '@/components/wordDict/DictAlphabetFilter.vue';
import commonApi from '@/common/commonApi'
import { useToastStore } from '@s/toastStore'; import { useToastStore } from '@s/toastStore';
const { appContext } = getCurrentInstance(); const { appContext } = getCurrentInstance();
@ -87,7 +88,7 @@
const total = ref(0); const total = ref(0);
// //
const cateList = ref([]); const { cateList } = commonApi();
const selectedCategory = ref(''); const selectedCategory = ref('');
// //
@ -102,7 +103,6 @@
// //
onMounted(() => { onMounted(() => {
getwordList(); getwordList();
getwordCategory();
}); });
// //
@ -128,17 +128,7 @@
loading.value = false; loading.value = false;
}); });
}; };
//
const getwordCategory = () => {
axios.get('worddict/getWordCategory')
.then(res => {
cateList.value = res.data.data;
})
.catch(err => {
console.error('카테고리 로드 오류:', err);
error.value = '카테고리 데이터를 가져오는 중 문제가 발생했습니다.';
});
};
// //
const search = (e) => { const search = (e) => {
searchText.value = e.trim(); searchText.value = e.trim();