From cb1f366d35e4cf9f20e5d7f13161aaa2ccd1d784 Mon Sep 17 00:00:00 2001 From: liyasthomas Date: Wed, 4 Sep 2019 07:15:19 +0530 Subject: [PATCH] :sparkles: Copy generated code to clipboard --- pages/index.vue | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/pages/index.vue b/pages/index.vue index 6a8c1cedd..7a90bf5a0 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -24,7 +24,7 @@
  • -
  • - +
  • @@ -46,17 +51,30 @@
    • - -
    -
    - -
    +
      +
    • +
      + +
      + +
      +
      + +
    • +
      @@ -670,6 +688,12 @@ document.body.removeChild(dummy); setTimeout(() => this.$refs.copyRequest.innerHTML = this.copyButton + 'Share URL', 1500) }, + copyRequestCode() { + this.$refs.copyRequestCode.innerHTML = this.copiedButton + 'Copied'; + this.$refs.generatedCode.select(); + document.execCommand("copy"); + setTimeout(() => this.$refs.copyRequestCode.innerHTML = this.copyButton + 'Copy', 1500) + }, copyResponse() { this.$refs.copyResponse.innerHTML = this.copiedButton + 'Copied'; this.$refs.responseBody.select();