fix:设置工具栏按钮颜色

This commit is contained in:
lhj
2024-11-14 00:19:52 +08:00
parent 91aab43ecb
commit 116e28b8fa

View File

@ -1,5 +1,6 @@
<template>
<div
style="width: fit-content; display: flex; flex-direction: column;"
v-if="componentVisible || store.designerMode"
:id="componentId"
:class="[
@ -13,9 +14,10 @@
>
<div v-if="isClicked" class="component-header">
<span>{{ componentName }}</span>
<button @click="handleFunction('edit')">编辑</button>
<button @click="handleFunction('delete')">删除</button>
<button style="color: #1057CC" @click="handleFunction('edit')">编辑</button>
<button style="color: #1057CC" @click="handleFunction('delete')">删除</button>
</div>
<div class="component-content">
<component
:is="componentType"
v-bind="componentPropsWithDisabled"
@ -31,6 +33,7 @@
</template>
</component>
</div>
</div>
</template>
<script setup lang="ts">
@ -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;
}
</style>