Skip to content

BaseDragHandle ​

@qingpai/core 拖拽插件的 Vue 无样式包装:负责 editor 绑定、插件注册/注销与重定位配置透传,本身不带任何手柄 UI。通常直接使用带样式的 DragHandle,需要完全自定义手柄外观与交互时使用本组件。

用法 ​

vue
<script setup lang="ts">
import { BaseDragHandle } from '@qingpai/vue'
</script>

<template>
  <BaseDragHandle :editor="editor">
    <span class="my-drag-handle">⠿</span>
  </BaseDragHandle>
</template>

Props ​

Prop类型默认值必填说明
editorEditor—是编辑器实例(必传)
pluginKeyPluginKey | string插件默认 key否插件实例标识
computePositionConfigComputePositionConfig{}否悬停定位配置(与默认配置合并)
onNodeChange(data: { node: Node | null, editor: Editor, pos: number }) => void—否悬停目标节点变化回调
onElementDragStart(event: DragEvent) => void—否拖拽开始回调
onElementDragEnd(event: DragEvent) => void—否拖拽结束回调
classstring'qp-base-drag-handle'否手柄根元素类名
nestedboolean | NestedOptionsfalse否嵌套内容拖拽(列表项、引用块等),规则评分制选取目标节点

插槽 ​

名称参数说明
default—手柄内容(渲染于插件控制的根元素内)

事件 ​

无。

轻排编辑器 — 教育领域富文本编辑器