This commit is contained in:
陆柯 2023-03-26 15:16:42 +08:00
parent 11d2e98ef9
commit 5eb2b729ed

View File

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