From 6f52ed7c1b95daea0cf6a191a2cda919cb65390d Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Sat, 28 Dec 2024 05:12:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E7=AA=97=E5=8F=A3=E7=9A=84re?= =?UTF-8?q?size?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/right-nav.js | 23 ++++++++++- src/components/right-nav.vue | 64 ++++++++++++++++++++++++----- src/components/treeview/index.vue | 14 +++++-- src/components/treeview/info.vue | 14 +++++++ src/components/treeview/modules.vue | 16 ++++---- src/components/treeview/tree.js | 13 ++++++ src/hook/global.js | 12 ++++-- 7 files changed, 131 insertions(+), 25 deletions(-) create mode 100644 src/components/treeview/info.vue diff --git a/src/components/right-nav.js b/src/components/right-nav.js index 41f2f3e..36fd060 100644 --- a/src/components/right-nav.js +++ b/src/components/right-nav.js @@ -17,8 +17,29 @@ export const controlPanel = reactive({ if (this.currentIndex === index) { this.currentIndex = -1; } else { + if (horizontalResizer.width < 5) { + horizontalResizer.width = 200; + } this.currentIndex = index; } } -}); \ No newline at end of file +}); + +export const horizontalResizer = reactive({ + active: false, + hover: false, + width: 200, + mousedown() { + this.active = true; + document.addEventListener('mousemove', resize); + } +}); + +export function resize(event) { + // 50 是 --right-nav-width + const computedWidth = window.innerWidth - event.clientX - 50; + if (computedWidth >= 0 && computedWidth <= 2000) { + horizontalResizer.width = computedWidth; + } +} \ No newline at end of file diff --git a/src/components/right-nav.vue b/src/components/right-nav.vue index 3ea2fe3..eb27583 100644 --- a/src/components/right-nav.vue +++ b/src/components/right-nav.vue @@ -1,13 +1,22 @@ \ No newline at end of file diff --git a/src/components/treeview/info.vue b/src/components/treeview/info.vue new file mode 100644 index 0000000..2e2bf96 --- /dev/null +++ b/src/components/treeview/info.vue @@ -0,0 +1,14 @@ + + + \ No newline at end of file diff --git a/src/components/treeview/modules.vue b/src/components/treeview/modules.vue index a75f1f3..f93a749 100644 --- a/src/components/treeview/modules.vue +++ b/src/components/treeview/modules.vue @@ -9,7 +9,11 @@ -
+
@@ -33,6 +37,7 @@