style(editor): 调整已选组件节点右侧按钮样式

This commit is contained in:
roymondchen 2025-12-04 16:36:34 +08:00
parent 7e71c070f1
commit a2a9556ab8
2 changed files with 24 additions and 3 deletions

View File

@ -1,7 +1,12 @@
<template> <template>
<template v-if="data.type !== 'page'"> <template v-if="data.type !== 'page'">
<MIcon v-if="data.visible === false" :icon="Hide" @click.stop="setNodeVisible(true)" title="点击显示"></MIcon> <TMagicButton
<MIcon v-else :icon="View" @click.stop="setNodeVisible(false)" class="node-lock" title="点击隐藏"></MIcon> link
:type="data.visible === false ? 'primary' : 'default'"
:icon="data.visible === false ? Hide : View"
:title="data.visible === false ? '点击显示' : '点击隐藏'"
@click.stop="setNodeVisible(data.visible === false)"
></TMagicButton>
</template> </template>
</template> </template>
@ -9,8 +14,8 @@
import { Hide, View } from '@element-plus/icons-vue'; import { Hide, View } from '@element-plus/icons-vue';
import type { MNode } from '@tmagic/core'; import type { MNode } from '@tmagic/core';
import { TMagicButton } from '@tmagic/design';
import MIcon from '@editor/components/Icon.vue';
import { useServices } from '@editor/hooks/use-services'; import { useServices } from '@editor/hooks/use-services';
const props = defineProps<{ const props = defineProps<{

View File

@ -5,6 +5,22 @@
.m-editor-tree { .m-editor-tree {
padding-top: 48px; padding-top: 48px;
.tree-node-tool {
padding-right: 10px;
.tmagic-design-button + .tmagic-design-button {
margin-left: 2px;
}
}
.tree-node.selected {
.tree-node-tool {
.tmagic-design-button {
color: #fff;
}
}
}
} }
.search-wrapper { .search-wrapper {