refactor: ♻️ 重构API为静态方法实现模块化管理,并将types.ts重命名为model.ts用于存放接口模型定义
This commit is contained in:
@@ -21,8 +21,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getDeptOptions } from "@/api/dept";
|
||||
|
||||
import DeptAPI from "@/api/dept";
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: [Number],
|
||||
@@ -62,8 +61,8 @@ function handleNodeClick(data: { [key: string]: any }) {
|
||||
}
|
||||
|
||||
onBeforeMount(() => {
|
||||
getDeptOptions().then((response) => {
|
||||
deptList.value = response.data;
|
||||
DeptAPI.getOptions().then((data) => {
|
||||
deptList.value = data;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user