From 1d5b1f21a0ecbf0f8c9a234c7a6fa184852f9055 Mon Sep 17 00:00:00 2001 From: khatabwedaa Date: Wed, 6 May 2020 14:34:27 +0200 Subject: [PATCH] build copied pop --- src/components/Master.vue | 4 ++- src/components/Utilities/CodeSnippet.vue | 15 +++------ src/components/Utilities/ViewComponent.vue | 39 +++++++++++++++++++--- 3 files changed, 41 insertions(+), 17 deletions(-) diff --git a/src/components/Master.vue b/src/components/Master.vue index c2bb372..aae0c8e 100644 --- a/src/components/Master.vue +++ b/src/components/Master.vue @@ -31,7 +31,9 @@

- +
+ +
diff --git a/src/components/Utilities/CodeSnippet.vue b/src/components/Utilities/CodeSnippet.vue index 8d741c0..396bad2 100644 --- a/src/components/Utilities/CodeSnippet.vue +++ b/src/components/Utilities/CodeSnippet.vue @@ -1,14 +1,6 @@ @@ -23,6 +15,7 @@ mounted() { this.highlightCode(); }, + methods: { highlightCode() { this.$nextTick(() => { @@ -31,6 +24,6 @@ }); }); }, - } + }, } - \ No newline at end of file + diff --git a/src/components/Utilities/ViewComponent.vue b/src/components/Utilities/ViewComponent.vue index a89bab4..f824e15 100644 --- a/src/components/Utilities/ViewComponent.vue +++ b/src/components/Utilities/ViewComponent.vue @@ -23,20 +23,30 @@ - +
-
- +
+ + +
+
+
+

Copied!

+
+
+
+
@@ -63,7 +73,8 @@ return { viewCode: false, rtl: false, - code: null + copy: false, + code: null, } }, created() { @@ -72,5 +83,23 @@ this.code = beautify_html(document.getElementById(id).innerHTML); }); }, + methods: { + onCopy() { + this.copy = ! this.copy; + + setTimeout(() => { + this.copy = false + }, 2000); + }, + }, } - \ No newline at end of file + + + \ No newline at end of file