my.setClipboard

Set the clipboard data.

Sample Code

copy
Page({
  data: {
    text: '3.1415926',
    copy: '',
  },

  handleCopy() {
    my.setClipboard({
      text: this.data.text,
    });
  },
});

Parameters

PropertyType

Required

Description
textStringYesClipboard data.
successFunctionNoCallback function upon call success.
failFunctionNoCallback function upon call failure.
completeFunctionNoCallback function upon call completion (to be executed upon either call success or failure).