From 73a6b9928de70e82f88207c5058108cf9b0d4871 Mon Sep 17 00:00:00 2001 From: daeyeon ko Date: Tue, 7 Jan 2025 19:05:30 +0900 Subject: [PATCH 1/4] refactor: changing resizer line to fatter when it hoverd Signed-off-by: daeyeon ko --- .../vertical-layout/PVerticalLayout.vue | 176 +++++++++++------- 1 file changed, 104 insertions(+), 72 deletions(-) diff --git a/packages/mirinae/src/layouts/vertical-layout/PVerticalLayout.vue b/packages/mirinae/src/layouts/vertical-layout/PVerticalLayout.vue index b1aec14be0..a96b751810 100644 --- a/packages/mirinae/src/layouts/vertical-layout/PVerticalLayout.vue +++ b/packages/mirinae/src/layouts/vertical-layout/PVerticalLayout.vue @@ -11,11 +11,11 @@ import screens from '@/styles/screens.cjs'; const MOBILE_WIDTH = '312'; interface Props { - height?: string; - initWidth?: number; - minWidth?: number; - maxWidth?: number; - enableDoubleClickResize? : boolean; + height?: string; + initWidth?: number; + minWidth?: number; + maxWidth?: number; + enableDoubleClickResize? : boolean; } const props = withDefaults(defineProps(), { @@ -60,7 +60,11 @@ const state = reactive({ })), resizerStyle: computed(() => ({ left: `${state.width}px`, - 'border-left-width': state.hide ? 0 : '1px', + width: 'fit-content', + })), + resizerLineStyle: computed(() => ({ + // eslint-disable-next-line no-nested-ternary + width: state.hide ? 0 : state.isHover ? '2px' : '1px', })), mainStyle: computed(() => ({ width: state.isMobileSize ? '100%' : `calc( 100% - ${state.width}px )`, @@ -97,17 +101,17 @@ const isResizing = (event) => { resize(width); } state.clientX = event.clientX; - state.isHover = true; + // state.isHover = true; } }; const endResizing = () => { state.resizing = false; state.clientX = null; - state.isHover = false; + // state.isHover = false; }; const startResizing = () => { state.resizing = true; - state.isHover = true; + // state.isHover = true; }; /* Toggle hide Sidebar */ @@ -168,6 +172,9 @@ onBeforeMount(() => { detectWindowResizing(); }); +function test() { + state.isHover = !state.isHover; +}