refactor(components): 优化 contenteditable 组件中的编辑器操作显示逻辑

- 使用 Teleport 组件将编辑器操作渲染到 body 中,提高灵活性和可用性
- 添加调试日志,便于开发和排查问题
This commit is contained in:
陈昱达
2025-03-25 18:19:59 +08:00
parent 0261ff0672
commit 0e2c1540cb

View File

@@ -22,11 +22,14 @@
<slot name="right-icon"></slot>
</div>
</div>
<div v-if="showAction && active" ref="editorAction" class="editor-action">
<button v-for="item in actions" :key="item.name" @click="funEvent(item, $event)">
<van-icon class-prefix="mobilefont" :name="item.icon"></van-icon>
</button>
</div>
<teleport to="body">
<div v-if="showAction && active" ref="editorAction" class="editor-action">
<button v-for="item in actions" :key="item.name" @click="funEvent(item, $event)">
<van-icon class-prefix="mobilefont" :name="item.icon"></van-icon>
</button>
</div>
</teleport>
<div class="error-message">
{{ errorMessage }}
<!-- <slot name="error"></slot>-->