From 5eb2b729edab3406f7567c2b1e978a89a65aa7b9 Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Sun, 26 Mar 2023 15:16:42 +0800 Subject: [PATCH] u --- unitool.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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)}`, + }) }, }) },