copy = (text, container) => {
  return new Promise(function(resolve, reject) {
    var fakeElement = document.createElement("button");
    var clipboard = new Clipboard(fakeElement, {
      text: function() {
        return text;
      },
      action: function() {
        return "copy";
      },
      container: typeof container === "object" ? container : document.body,
    });
    clipboard.on("success", function(e) {
      clipboard.destroy();
      resolve(e);
    });
    clipboard.on("error", function(e) {
      clipboard.destroy();
      reject(e);
    });
    if (VueClipboardConfig.appendToBody) document.body.appendChild(fakeElement);
    fakeElement.click();
    if (VueClipboardConfig.appendToBody) document.body.removeChild(fakeElement);
  });
}
reference vue-clipboard2
https://github.com/Inndy/vue-clipboard2