Appearance
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 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
editor | Editor | — | 是 | 编辑器实例(必传) |
pluginKey | PluginKey | string | 插件默认 key | 否 | 插件实例标识 |
computePositionConfig | ComputePositionConfig | {} | 否 | 悬停定位配置(与默认配置合并) |
onNodeChange | (data: { node: Node | null, editor: Editor, pos: number }) => void | — | 否 | 悬停目标节点变化回调 |
onElementDragStart | (event: DragEvent) => void | — | 否 | 拖拽开始回调 |
onElementDragEnd | (event: DragEvent) => void | — | 否 | 拖拽结束回调 |
class | string | 'qp-base-drag-handle' | 否 | 手柄根元素类名 |
nested | boolean | NestedOptions | false | 否 | 嵌套内容拖拽(列表项、引用块等),规则评分制选取目标节点 |
插槽
| 名称 | 参数 | 说明 |
|---|---|---|
default | — | 手柄内容(渲染于插件控制的根元素内) |
事件
无。