CopyText ​

带状态反馈的复制文本组件,封装剪贴板写入逻辑,提供加载、已复制、出错三种视觉状态。

使用
反馈
文档

基础用法 ​

自定义展示内容 ​

自定义图标 ​

禁用状态 ​

API ​

Props ​

名称类型默认值必填说明
copyLabelstring | undefined"复制"—Accessible label and tooltip shown before a successful copy.
copiedLabelstring | undefined"已复制"—Accessible label and tooltip shown after a successful copy.
textstring—是Plain text written to the clipboard.
disabledboolean | undefinedfalse—Prevent copy commands while preserving the slot state.
resetDelaynumber | undefined2000—Time before the copied state resets. Set to 0 to keep it until the next command.

Emits ​

名称参数说明
error—
copy[text: string]—

Slots ​

名称作用域说明
default—
icon—

Expose ​

名称类型说明
copy—
reset() => void—

组件贡献者 ​