feat:【代码优化】减少部分模块的 import * 的 API

This commit is contained in:
YunaiV
2025-10-27 09:34:45 +08:00
parent d2db16c8c6
commit 86c68b5466
35 changed files with 185 additions and 164 deletions

View File

@@ -3,7 +3,7 @@ import { computed, onMounted, ref } from 'vue';
import { handleTree } from '@vben/utils';
import * as ProductCategoryApi from '#/api/mall/product/category';
import { getCategoryList } from '#/api/mall/product/category';
/** 商品分类选择组件 */
defineOptions({ name: 'ProductCategorySelect' });
@@ -42,8 +42,7 @@ const selectCategoryId = computed({
/** 初始化 */
const categoryList = ref<any[]>([]); // 分类树
onMounted(async () => {
// 获得分类树
const data = await ProductCategoryApi.getCategoryList({
const data = await getCategoryList({
parentId: props.parentId,
});
categoryList.value = handleTree(data, 'id', 'parentId');