From c1f3891eda2d83066faac9f750a40506f29b5e54 Mon Sep 17 00:00:00 2001 From: dhb52 Date: Sat, 18 May 2024 23:50:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0:min-s?= =?UTF-8?q?ize=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/operate-drawer.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/common/operate-drawer.vue b/src/components/common/operate-drawer.vue index fd8dc82..00ede7a 100644 --- a/src/components/common/operate-drawer.vue +++ b/src/components/common/operate-drawer.vue @@ -7,9 +7,10 @@ defineOptions({ }); interface Props { - title?: string; + title: string; + minSize?: number; } -const props = defineProps(); +const props = withDefaults(defineProps(), { minSize: 360 }); interface Emits { (e: 'update:modelValue', modelValue: boolean): void; @@ -25,8 +26,8 @@ const appStore = useAppStore(); const state = reactive({ width: 0 }); const isFullscreen = ref(false); const drawerWidth = computed(() => { - const maxMinWidth = 360; - const maxMaxWidth = 600; + const maxMinWidth = props.minSize; + const maxMaxWidth = Math.max(props.minSize, 600); if (appStore.isMobile) { return state.width * 0.9 >= maxMinWidth ? `${maxMinWidth}px` : '90%'; }