fix:设置工具栏按钮颜色
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div
|
||||
style="width: fit-content; display: flex; flex-direction: column;"
|
||||
v-if="componentVisible || store.designerMode"
|
||||
:id="componentId"
|
||||
:class="[
|
||||
@ -13,23 +14,25 @@
|
||||
>
|
||||
<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"
|
||||
:class="componentClass"
|
||||
:style="componentStyle"
|
||||
>
|
||||
{{ componentText }}
|
||||
<template v-for="child in componentChildren" :key="child.id">
|
||||
<DynamicComponent :component-data="child" />
|
||||
</template>
|
||||
<template v-for="(slot, key, index) in componentSlots" :key="index" v-slot:[key]>
|
||||
<DynamicComponent :component-data="slot" />
|
||||
</template>
|
||||
</component>
|
||||
</div>
|
||||
<component
|
||||
:is="componentType"
|
||||
v-bind="componentPropsWithDisabled"
|
||||
:class="componentClass"
|
||||
:style="componentStyle"
|
||||
>
|
||||
{{ componentText }}
|
||||
<template v-for="child in componentChildren" :key="child.id">
|
||||
<DynamicComponent :component-data="child" />
|
||||
</template>
|
||||
<template v-for="(slot, key, index) in componentSlots" :key="index" v-slot:[key]>
|
||||
<DynamicComponent :component-data="slot" />
|
||||
</template>
|
||||
</component>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -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>
|
||||
Reference in New Issue
Block a user