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

PropertyType

Required

Description
successFunctionNoCallback function upon call success.
failFunctionNoCallback function upon call failure.
completeFunctionNoCallback 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:

PropertyTypeDescription
textStringClipboard data.