This commit is contained in:
iqudoo
2026-05-25 11:03:58 +08:00
parent 4c359214f5
commit a74a20049a

View File

@@ -797,7 +797,7 @@
v-model="showExportDrawer" v-model="showExportDrawer"
title="导出文档" title="导出文档"
direction="rtl" direction="rtl"
size="480px" :size="exportDrawerSize"
class="export-drawer" class="export-drawer"
> >
<div class="export-module"> <div class="export-module">
@@ -970,6 +970,7 @@ const currentApi = ref(null);
const apiDetail = ref(null); const apiDetail = ref(null);
const searchQuery = ref(""); const searchQuery = ref("");
const isMobile = ref(false); const isMobile = ref(false);
const windowWidth = ref(typeof window !== "undefined" ? window.innerWidth : 800);
const showMenu = ref(false); const showMenu = ref(false);
const currentPath = ref([]); // 当前路径,用于记录层级 const currentPath = ref([]); // 当前路径,用于记录层级
const currentPathKeys = ref([]); // 当前路径的key数组 const currentPathKeys = ref([]); // 当前路径的key数组
@@ -990,6 +991,10 @@ const exportTreeProps = {
const hostUrl = ref(import.meta.env.VITE_API_URL || "/api"); const hostUrl = ref(import.meta.env.VITE_API_URL || "/api");
const showExportDrawer = ref(false); const showExportDrawer = ref(false);
const exportDrawerSize = computed(() => {
if (isMobile.value) return "100%";
return `${Math.min(800, windowWidth.value)}px`;
});
// 监听搜索,如果有搜索则自动返回根级别显示所有匹配结果 // 监听搜索,如果有搜索则自动返回根级别显示所有匹配结果
watch(searchQuery, (newVal) => { watch(searchQuery, (newVal) => {
@@ -1228,7 +1233,8 @@ const goToApi = (api) => {
}; };
const checkDeviceType = () => { const checkDeviceType = () => {
isMobile.value = window.innerWidth <= 768; windowWidth.value = window.innerWidth;
isMobile.value = windowWidth.value <= 768;
showMenu.value = !isMobile.value; showMenu.value = !isMobile.value;
}; };