File tree Expand file tree Collapse file tree 4 files changed +22
-22
lines changed Expand file tree Collapse file tree 4 files changed +22
-22
lines changed Original file line number Diff line number Diff line change
1
+ declare module 'diff-match-patch'
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" h-full" >
3
- <main class =" container h-full mx-auto mt-24" >
3
+ <main class =" h-full mt-24 xl:container " >
4
4
<div class =" flex gap-4 mt-5" >
5
5
<div
6
6
class =" flex-1 p-4 overflow-y-auto border-2 rounded-sm max-h-screen--nav"
22
22
</template >
23
23
24
24
<script >
25
- import DiffMatchPatch from ' diff-match-patch'
26
- import { urlDecode } from ' ../../../helpers/utils'
27
- const dmp = new DiffMatchPatch ()
25
+ import { urlDecode } from ' ../../helpers/utils'
28
26
export default {
29
27
layout: ' main' ,
30
- lhs: ' ' ,
31
- rhs: ' ' ,
32
- diff: [],
33
28
mounted () {
34
- const { lhs , rhs } = this .$route .params
35
- this .originalLhs = urlDecode (lhs).split (' \n ' )
36
- this .originalRhs = urlDecode (rhs).split (' \n ' )
37
- const diff = this .originalLhs .map ((x , i ) => {
38
- if (! this .originalRhs [i]) {
39
- this .originalRhs [i] = ' '
40
- }
41
- return dmp .diff_main (x, this .originalRhs [i])
42
- })
29
+ const { diff: _diff } = this .$route .params
30
+ const diff = JSON .parse (urlDecode (_diff))
43
31
this .lhsDiff = diff
44
32
.map ((lineDiff ) => {
45
33
return lineDiff
@@ -71,9 +59,6 @@ export default {
71
59
},
72
60
data () {
73
61
return {
74
- diff: this .diff ,
75
- originalRhs: this .originalRhs ,
76
- originalLhs: this .originalLhs ,
77
62
lhsDiff: this .lhsDiff ,
78
63
rhsDiff: this .rhsDiff ,
79
64
}
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" h-full" >
3
- <main class =" container h-full mx-auto mt-24" >
3
+ <main class =" h-full mt-24 xl:container " >
4
4
<form @submit =" checkForm" class =" w-full h-full" >
5
5
<div class =" flex flex-wrap w-full h-full gap-4" >
6
6
<textarea
25
25
</template >
26
26
27
27
<script lang="ts">
28
+ import DiffMatchPatch from ' diff-match-patch'
28
29
import Vue from ' vue'
29
30
import { urlEncode } from ' ../helpers/utils'
31
+ const dmp = new DiffMatchPatch ()
30
32
export default Vue .extend ({
31
33
layout: ' main' ,
32
34
methods: {
@@ -40,8 +42,17 @@ export default Vue.extend({
40
42
' rhs'
41
43
) as HTMLTextAreaElement
42
44
const rhs: string = rhsTextArea ?.value || ' '
45
+
46
+ const originalLhs = lhs .split (' \n ' )
47
+ const originalRhs = rhs .split (' \n ' )
48
+ const diff = originalLhs .map ((x , i ) => {
49
+ if (! originalRhs [i ]) {
50
+ originalRhs [i ] = ' '
51
+ }
52
+ return dmp .diff_main (x , originalRhs [i ])
53
+ })
43
54
this .$router .push ({
44
- path: ` /diff/${urlEncode (lhs )}/${ urlEncode ( rhs )} ` ,
55
+ path: ` /diff/${urlEncode (JSON . stringify ( diff ) )} ` ,
45
56
})
46
57
},
47
58
},
Original file line number Diff line number Diff line change @@ -3,7 +3,10 @@ module.exports = {
3
3
theme : {
4
4
maxHeight : {
5
5
'screen--nav' : 'calc(100vh - 7rem)' ,
6
- }
6
+ } ,
7
+ container : {
8
+ center : true ,
9
+ } ,
7
10
} ,
8
11
plugins : [
9
12
require ( '@tailwindcss/forms' ) ,
You can’t perform that action at this time.
0 commit comments