iter(g235): 新增 copyButton 复制按钮,剪贴板写入带已复制反馈与降级(72 组件)

This commit is contained in:
HIsheR
2026-10-26 21:26:11 +08:00
parent 7e5e9f50d6
commit 5443aad8be
11 changed files with 208 additions and 10 deletions
+13
View File
@@ -27,6 +27,7 @@ import {
colorPicker,
timePicker,
commandPalette,
copyButton,
dataTable,
datePicker,
transfer,
@@ -1093,6 +1094,18 @@ const content = h(
),
h('div', { class: 'row' }, pinInput({ value: signal(''), length: 6, disabled: true })),
),
section(
'sec-copybutton',
'复制按钮',
'copyButton:点击写入剪贴板,成功后短暂换成「已复制」再还原;text 可传函数取实时值,剪贴板 API 不可用时自动降级 execCommand。',
h(
'div',
{ class: 'row' },
copyButton({ text: 'npm install @ui-arch/ui', onCopied: (t) => toast.success(`已复制:${t}`) }),
copyButton({ text: () => pinCode() || '尚未输入验证码', label: '复制上方验证码' }),
copyButton({ text: '禁用态示例', disabled: true }),
),
),
section(
'sec-affix',
'固钉',