refactor(components): 优化 contenteditable 组件中的编辑器操作显示逻辑
- 使用 Teleport 组件将编辑器操作渲染到 body 中,提高灵活性和可用性 - 添加调试日志,便于开发和排查问题
This commit is contained in:
@@ -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>-->
|
||||
|
||||
Reference in New Issue
Block a user