11<template >
22 <div class =" contents" >
33 <Navbar show-back-button =" true" >
4- <template v-slot : right >
4+ <template # right >
55 <button
66 type =" button"
7- @click =" copyUrlToClipboard"
87 class =" inline-flex justify-center px-4 py-2 transition-transform transform rounded-md shadow outline-none copy-uri-button align-center focus:ring-4 active:scale-y-75"
9- v-bind :class =" {
8+ :class =" {
109 'bg-blue-500 text-white': !copied,
1110 'bg-green-500 text-gray-800': copied,
1211 }"
12+ @click =" copyUrlToClipboard"
1313 >
14- <span class =" inline-flex justify-center" v-show = " copied " >
14+ <span v-show = " copied " class =" inline-flex justify-center" >
1515 <svg
1616 class =" inline-block w-6 h-6 ml-[-4px]"
1717 fill =" none"
2828 </svg >
2929 <span class =" hidden ml-2 md:inline-block" >Copied</span >
3030 </span >
31- <span class =" inline-flex justify-center" v-show = " !copied " >
31+ <span v-show = " !copied " class =" inline-flex justify-center" >
3232 <svg
3333 class =" w-6 h-6"
3434 fill =" none"
5555 <div
5656 class =" relative flex-1 px-4 py-2 overflow-y-auto border-2 rounded-md dark:border-gray-500 max-h-screen--nav line-number-gutter min-h-80"
5757 >
58- <RTStickyCopyButton :clickHandler =" copyTextToClipboard" />
58+ <RTStickyCopyButton :click-handler =" copyTextToClipboard" />
5959 <div
6060 v-for =" (lineDiff, index) in lhsDiff"
6161 :key =" index"
62- v-bind :class =" {
62+ :class =" {
6363 'bg-red-100 dark:bg-yellow-700': lineDiff.includes('isModified'),
6464 }"
6565 >
6969 <div
7070 class =" relative flex-1 px-4 py-2 overflow-y-auto border-2 rounded-md dark:border-gray-500 min-h-80 line-number-gutter max-h-screen--nav"
7171 >
72- <RTStickyCopyButton :clickHandler =" copyTextToClipboard" />
72+ <RTStickyCopyButton :click-handler =" copyTextToClipboard" />
7373 <div
7474 v-for =" (lineDiff, index) in rhsDiff"
7575 :key =" index"
76- v-bind :class =" {
76+ :class =" {
7777 'bg-green-100 dark:bg-green-700': lineDiff.includes('isModified'),
7878 }"
7979 >
@@ -90,6 +90,13 @@ import pako from 'pako'
9090import { undoUrlSafeBase64 } from ' ../helpers/utils'
9191export default {
9292 layout: ' main' ,
93+ data () {
94+ return {
95+ lhsDiff: this .lhsDiff ,
96+ rhsDiff: this .rhsDiff ,
97+ copied: false ,
98+ }
99+ },
93100 mounted () {
94101 const _diff = this .$route .hash
95102 const gunzip = pako .ungzip (Buffer .from (undoUrlSafeBase64 (_diff), ' base64' ))
@@ -129,13 +136,6 @@ export default {
129136 ` ${ ` ${ maxLineCount} ` .split (' ' ).length } ch`
130137 )
131138 },
132- data () {
133- return {
134- lhsDiff: this .lhsDiff ,
135- rhsDiff: this .rhsDiff ,
136- copied: false ,
137- }
138- },
139139 methods: {
140140 putToClipboard (textToPut , toastContent ) {
141141 navigator .clipboard .writeText (textToPut)
0 commit comments