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