HeadlessCopyText
无头复制文本原语,提供状态与逻辑,UI 完全由默认插槽自定义。
基础用法
带动画反馈
API
Props
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| text | string | — | 是 | Plain text written to the clipboard. |
| disabled | boolean | undefined | false | — | Prevent copy commands while preserving the slot state. |
| resetDelay | number | undefined | 2000 | — | Time before the copied state resets. Set to 0 to keep it until the next command. |
Emits
| 名称 | 参数 | 说明 |
|---|---|---|
| error | — | |
| copy | [text: string] | — |
Slots
| 名称 | 作用域 | 说明 |
|---|---|---|
| default | — |
Expose
| 名称 | 类型 | 说明 |
|---|---|---|
| copy | — | |
| reset | () => void | — |