tencent cloud

All product documents
Tencent Cloud Super App as a Service
Clipboard
Last updated: 2025-04-10 18:18:36
Clipboard
Last updated: 2025-04-10 18:18:36

setClipboardData

This API is used via wx.setClipboardData(Object object).
Feature Description: Sets the content of the system clipboard. For individual users, it should not be invoked more than once per second.
Parameter and Description: Object.
Attribute
Type
Default value
Required
Description
data
string
-
Yes
Clipboard content
success
function
-
No
Callback Function of Successful Interface Call
fail
function
-
No
Callback Function of Failing Interface Call
complete
function
-
No
Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)
Sample Code
wx.setClipboardData({
data: 'data',
success(res) {
wx.getClipboardData({
success(res) {
console.log(res.data) // data
}
})
}
})

getClipboardData

This API is used via wx.getClipboardData(Object object).
Feature Description: Gets the content of the system clipboard. For individual users, the invocation does not exceed 1 time per second.
Parameter and Description: Object.
Attribute
Type
Default value
Required
Description
success
function
-
No
Callback Function of Successful Interface Call
fail
function
-
No
Callback Function of Failing Interface Call
complete
function
-
No
Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)
object.success callback function: Object.
Attribute
Type
Description
data
string
Clipboard content
Sample Code
wx.getClipboardData({
success(res) {
console.log(res.data)
}
})

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support