Clipboard
setClipboardData
TIP
The API usage is as follows: wx.setClipboardData(Object object)
Functional description: Set the content of the system clipboard. For a single user, call no more than 1 time per second
Parameters and descriptions: Object object。
Properties Type Default value Required Description data string - Yes Clipboard content success Function - No Callback function for successful interface call fail Function - No Callback function for failed interface call complete Function - No Callback function for interface call completion (executed regardless of success or failure) Sample code:
js
wx.setClipboardData({
data: 'data',
success(res) {
wx.getClipboardData({
success(res) {
console.log(res.data) // data
}
})
}
})getClipboardData
TIP
The API usage is as follows: wx.getClipboardData(Object object)
Functional description: Get the content of the system clipboard. For a single user, call no more than 1 time per second
Parameters and descriptions: Object object。
Properties Type Default value Required Description success Function - No Callback function for successful interface call fail Function - No Callback function for failed interface call complete Function - No Callback function for interface call completion (executed regardless of success or failure) object.success callback function parameters: Object Object。
Properties Type Description data string Clipboard content Sample code:
js
wx.getClipboardData({
success(res) {
console.log(res.data)
}
})