This commit is contained in:
X1627315083
2025-09-12 14:58:07 +08:00
parent f760478594
commit 1df3458ac5
20 changed files with 85 additions and 57 deletions

View File

@@ -328,6 +328,9 @@ const handleToolClick = (tool) => {
style="width: 0; height: 0; opacity: 0"
/>
<slot name="customToolsTop" :tool-button-props="{ activeTool, canUndo, canRedo }" />
<ToolButton
v-for="tool in toolsList"
:key="tool.id"
@@ -339,7 +342,7 @@ const handleToolClick = (tool) => {
/>
<!-- 自定义工具栏按钮插槽 -->
<slot name="customTools" :tool-button-props="{ activeTool, canUndo, canRedo }" />
<slot name="customToolsBottom" :tool-button-props="{ activeTool, canUndo, canRedo }" />
</div>
</template>

View File

@@ -1043,9 +1043,12 @@ defineExpose({
@zoom-out="zoomOut"
@undo-redo-status-changed="changeCanvas"
>
<template #customToolsTop="{ toolTopProps }">
<slot name="customToolsTop" :tool-button-props="toolTopProps" />
</template>
<!-- 扩展插槽 -->
<template #customTools="{ toolButtonProps }">
<slot name="customTools" :tool-button-props="toolButtonProps" />
<template #customToolsBottom="{ toolButtonProps }">
<slot name="customToolsBottom" :tool-button-props="toolButtonProps" />
</template>
</ToolsSidebar>
</div>

View File

@@ -218,7 +218,7 @@ const isShowLeft = ref(true);
</template>
<!-- 使用插槽添加自定义工具栏按钮 -->
<template #customTools="{ toolButtonProps }">
<template #customToolsBottom="{ toolButtonProps }">
<!-- 分隔线 -->
<div class="tool-separator"></div>