From 53e3aff7b09988389e49ed7b36878b8103dc29e8 Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Fri, 10 Nov 2023 15:55:36 +0800 Subject: [PATCH] bugfix: clip_to_clipboard --- unitool.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/unitool.js b/unitool.js index 56d0b54..bed5fe4 100644 --- a/unitool.js +++ b/unitool.js @@ -469,7 +469,7 @@ export default { } // #ifdef APP-PLUS uni.showToast({ icon: 'none', title, duration, ...rest }) - // plus.nativeUI.toast( title, { align: center/left/right, verticalAlign: bottom/center/top, duration:long/short, icon, iconWidth, iconHeight, style: block/inline }) 对应 plus.nativeUI.closeToast() + // plus.nativeUI.toast( title, { align: center/left/right, verticalAlign: bottom/center/top, duration:long/short, icon, iconWidth, iconHeight, style: block/inline, type:text/richtext }) // #endif // #ifndef APP-PLUS uni.showToast({ icon: 'none', image, title, duration, ...rest }) @@ -619,11 +619,15 @@ export default { data: text, success: () => { uni.hideToast() - if (!hidePrompt) + if (!hidePrompt) { + if (text.length > promptLength) { + text = String(text).substring(0, promptLength) + ' ...' + } wo?.tt?.showToast?.({ type: 'success', - title: `${wo?.ll?.({ zhCN: '已成功拷贝', enUS: 'Successfully copied' })}\n${String(text).substring(0, promptLength)}`, + title: `${wo?.ll?.({ zhCN: '已成功拷贝', enUS: 'Successfully copied' })}\n${text}`, }) + } }, }) },