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}`, }) + } }, }) },