# BlockHandle

> 编辑器内容块的拖拽手柄，用彩色标记显示块类型。

网页来源：/components/block-handle

版本：@quirekit/ui 0.3.1；源码修订：d79a6b48d00e+worktree。此文档对应当前源码构建，接入方式以开始使用为准。

接入前置：[开始使用](/raw/components/getting-started.md)（Vue、样式、主题与图标 Provider）。

## 块类型标记

`badge` 显示 H1 这类短文字，优先于 `icon`；`tone` 决定标记颜色，拖拽点保持弱化。手柄只负责外观，拖拽和菜单由编辑器通过事件接管，`aria-*` 与 `data-*` 属性会转发到按钮上。

手柄的宽度、高度和圆角固定（42×24，圆角 6px），不随主题的控件高度和圆角变化；编辑器可以用 `quireBlockHandleWidth` 与 `quireBlockHandleHeight` 预留边栏并对齐文本行，用 `quireBlockHandleRadius` 让同一边栏里的其他按钮保持相同圆角。

### 示例：block-handle/basic

文件：`basic.vue`

```vue
<script setup lang="ts">
import { QuireBlockHandle } from '@quirekit/ui/vue';
</script>
<template>
  <div class="flex flex-wrap items-center gap-qk-surface p-qk-surface">
    <QuireBlockHandle label="拖动标题" badge="H1" tone="blue" />
    <QuireBlockHandle label="拖动正文" icon="type" tone="blue" />
    <QuireBlockHandle label="拖动列表" icon="listBullet" tone="indigo" />
    <QuireBlockHandle label="拖动代码块" icon="codeXml" tone="green" />
    <QuireBlockHandle label="拖动表格" icon="table" tone="teal" />
    <QuireBlockHandle label="拖动流程图" icon="workflow" tone="purple" />
  </div>
</template>
```

## API

### QuireBlockHandle

#### Props

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| label | 是 | — | Accessible name; the type mark itself is decorative. |
| icon | 否 | — | Registered icon name, used when no badge is given. |
| badge | 否 | — | Short text mark such as H1, preferred over the icon. |
| tone | 否 | "neutral" | Color family of the type mark. |

**label**

```ts
string
```

**icon**

```ts
string | undefined
```

```ts
undefined | string
```

**badge**

```ts
string | undefined
```

```ts
undefined | string
```

**tone**

```ts
QuireBlockTone | undefined
```

```ts
undefined | "neutral" | "blue" | "indigo" | "green" | "orange" | "teal" | "purple"
```

#### Events

无。

#### Slots

无。

#### 公开实例成员

无。
