1
0
forked from Leaf/amber-ui

改进 移动端显示

This commit is contained in:
Twilight 2024-09-15 15:53:41 +08:00
parent b5415aded1
commit 06f78e1695
4 changed files with 10 additions and 8 deletions

View File

@ -249,9 +249,9 @@ const assistantApiKeys: Ref<EntityAssistantKey[]> = ref([]);
const isMobile = useIsMobile(); const isMobile = useIsMobile();
const drawerWidth = computed(() => { const drawerWidth = computed(() => {
if (isMobile.value) { if (isMobile.value) {
return 400; return window.innerWidth;
} else { } else {
return 600; return window.innerWidth * 0.6;
} }
}); });

View File

@ -92,12 +92,11 @@ import { useIsMobile } from "@/utils/composables";
const isMobile = useIsMobile(); const isMobile = useIsMobile();
const drawerWidth = computed(() => { const drawerWidth = computed(() => {
if (isMobile.value) { if (isMobile.value) {
return 400; return window.innerWidth;
} else { } else {
return 600; return window.innerWidth * 0.6;
} }
}); });
const dialog = useDialog(); const dialog = useDialog();
const chatStore = useChatStore(); const chatStore = useChatStore();
const showSettingsDialog = ref(false); const showSettingsDialog = ref(false);

View File

@ -67,12 +67,15 @@ const createToolRequest: Ref<SchemaToolCreateRequest> = ref({
const isMobile = useIsMobile(); const isMobile = useIsMobile();
const drawerWidth = computed(() => { const drawerWidth = computed(() => {
if (isMobile.value) { if (isMobile.value) {
return 400; return window.innerWidth;
} else { } else {
return 600; return window.innerWidth * 0.6;
} }
}); });
/**
* 获取所有工具
*/
const getTools = async () => { const getTools = async () => {
toolStore.tools = (await getApi().Tool.apiV1ToolsGet()).data.data ?? []; toolStore.tools = (await getApi().Tool.apiV1ToolsGet()).data.data ?? [];
}; };

View File

@ -137,7 +137,7 @@ const isMobile = useIsMobile();
const showDrawer = ref(false); const showDrawer = ref(false);
const width = computed(() => { const width = computed(() => {
if (isMobile.value) { if (isMobile.value) {
return window.innerWidth - 100; return window.innerWidth;
} else { } else {
return window.innerWidth * 0.5; return window.innerWidth * 0.5;
} }