my.getClipboard
Get the clipboard data.
Sample Code
copy
Page({
data: {
text: '3.1415926',
copy: '',
},
handlePaste() {
my.getClipboard({
success: ({ text }) => {
this.setData({ copy: text });
},
});
},
});Parameters
| Property | Type | Required | Description |
| success | Function | No | Callback function upon call success. |
| fail | Function | No | Callback function upon call failure. |
| complete | Function | No | Callback function upon call completion (to be executed upon either call success or failure). |
Success Callback Function
The incoming parameter is of the Object type with the following attributes:
| Property | Type | Description |
| text | String | Clipboard data. |