diff --git a/unitool.js b/unitool.js index e7bf38e..6b2bcbd 100644 --- a/unitool.js +++ b/unitool.js @@ -581,12 +581,15 @@ export default { } }, - copy_to_clipboard (text) { + copy_to_clipboard (text, toastLength = 50) { uni.setClipboardData({ data: text, success: () => { uni.hideToast() - wo.tt.showToast({ type: wo.c2t.GREEN, title: wo.ll({ zhCN: `已成功拷贝到剪贴板\n${text}`, enUS: `Successfully copied to clipboard\n${text}` }) }) + wo.tt.showToast({ + type: wo.c2t.GREEN, + title: `${wo.ll({ zhCN: '已成功拷贝到剪贴板', enUS: 'Successfully copied to clipboard ' })}\n${String(text).substring(0, toastLength)}`, + }) }, }) },