|
1 | 1 | <template> |
2 | | - <div class="h-full"> |
3 | | - <main class="h-full mt-24 xl:container"> |
4 | | - <div class="flex gap-4 mt-5"> |
5 | | - <div |
6 | | - class="flex-1 p-4 overflow-y-auto border-2 rounded-sm max-h-screen--nav" |
| 2 | + <div class="w-full h-full"> |
| 3 | + <Navbar show-back-button="true"> |
| 4 | + <template v-slot:right> |
| 5 | + <button |
| 6 | + type="button" |
| 7 | + @click="copyUrlToClipboard" |
| 8 | + class="inline-flex justify-center px-4 py-2 text-white transition-transform transform bg-blue-600 rounded-md shadow-lg outline-none align-center focus:ring-4 active:scale-y-75" |
7 | 9 | > |
8 | | - <p v-for="(lineDiff, index) in lhsDiff" :key="index"> |
9 | | - <span v-html="lineDiff"></span> |
10 | | - </p> |
| 10 | + <svg |
| 11 | + class="w-6 h-6 mr-2" |
| 12 | + fill="none" |
| 13 | + stroke="currentColor" |
| 14 | + viewBox="0 0 24 24" |
| 15 | + xmlns="http://www.w3.org/2000/svg" |
| 16 | + > |
| 17 | + <path |
| 18 | + stroke-linecap="round" |
| 19 | + stroke-linejoin="round" |
| 20 | + stroke-width="2" |
| 21 | + d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1" |
| 22 | + ></path> |
| 23 | + </svg> |
| 24 | + <span>Copy link</span> |
| 25 | + </button> |
| 26 | + </template> |
| 27 | + </Navbar> |
| 28 | + <div class="h-full"> |
| 29 | + <main class="h-full mt-24 xl:container"> |
| 30 | + <div class="flex gap-4 mt-5"> |
| 31 | + <div |
| 32 | + class="flex-1 p-4 overflow-y-auto border-2 rounded-sm max-h-screen--nav" |
| 33 | + > |
| 34 | + <p v-for="(lineDiff, index) in lhsDiff" :key="index"> |
| 35 | + <span v-html="lineDiff"></span> |
| 36 | + </p> |
| 37 | + </div> |
| 38 | + <div |
| 39 | + class="flex-1 p-4 overflow-y-auto border-2 rounded-sm max-h-screen--nav" |
| 40 | + > |
| 41 | + <p v-for="(lineDiff, index) in rhsDiff" :key="index"> |
| 42 | + <span v-html="lineDiff"></span> |
| 43 | + </p> |
| 44 | + </div> |
11 | 45 | </div> |
12 | | - <div |
13 | | - class="flex-1 p-4 overflow-y-auto border-2 rounded-sm max-h-screen--nav" |
14 | | - > |
15 | | - <p v-for="(lineDiff, index) in rhsDiff" :key="index"> |
16 | | - <span v-html="lineDiff"></span> |
17 | | - </p> |
18 | | - </div> |
19 | | - </div> |
20 | | - </main> |
| 46 | + </main> |
| 47 | + </div> |
21 | 48 | </div> |
22 | 49 | </template> |
23 | 50 |
|
24 | 51 | <script> |
25 | 52 | import { urlDecode } from '../../helpers/utils' |
26 | 53 | export default { |
27 | | - layout: 'main', |
28 | 54 | mounted() { |
29 | 55 | const { diff: _diff } = this.$route.params |
30 | 56 | const diff = JSON.parse(urlDecode(_diff)) |
@@ -63,5 +89,11 @@ export default { |
63 | 89 | rhsDiff: this.rhsDiff, |
64 | 90 | } |
65 | 91 | }, |
| 92 | + methods: { |
| 93 | + copyUrlToClipboard() { |
| 94 | + console.log('demo') |
| 95 | + navigator.clipboard.writeText(window.location.href) |
| 96 | + }, |
| 97 | + }, |
66 | 98 | } |
67 | 99 | </script> |
0 commit comments