From 116e28b8fa99f5417323a2def509f9bde4283ba9 Mon Sep 17 00:00:00 2001 From: lhj <403133128@qq.com> Date: Thu, 14 Nov 2024 00:19:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=AE=BE=E7=BD=AE=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E6=A0=8F=E6=8C=89=E9=92=AE=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DynamicComponent.vue | 50 +++++++++++++++++------------ 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/src/components/DynamicComponent.vue b/src/components/DynamicComponent.vue index 1ad55fd..0d9df9f 100644 --- a/src/components/DynamicComponent.vue +++ b/src/components/DynamicComponent.vue @@ -1,5 +1,6 @@ @@ -92,6 +95,7 @@ const handleFunction = (action: string) => { position: relative; border: 1px solid transparent; /* 默认透明边框 */ transition: border 0.3s, box-shadow 0.3s; + width: fit-content; } .dynamic-component.hover-state { @@ -104,12 +108,10 @@ const handleFunction = (action: string) => { .component-header { position: absolute; - top: 0; + top: -100px; /* 设置为负值,使工具栏浮在主内容之上 */ left: 0; - background-color: rgba(0, 0, 0, 0.8); - color: white; + color: #1057CC; padding: 5px; - border-radius: 4px; display: flex; align-items: center; justify-content: space-between; @@ -124,7 +126,7 @@ const handleFunction = (action: string) => { .component-header button { background-color: transparent; border: none; - color: white; + color: #1057CC; cursor: pointer; margin-left: 10px; } @@ -132,4 +134,10 @@ const handleFunction = (action: string) => { .component-header button:hover { text-decoration: underline; } + +.component-content { + flex-grow: 1; + position: relative; + z-index: 1; +} \ No newline at end of file