File tree 3 files changed +42
-58
lines changed
3 files changed +42
-58
lines changed Original file line number Diff line number Diff line change 4
4
<el-row :gutter =" 10" >
5
5
<el-col :span =" 12" >
6
6
<el-form-item label =" 旧数据:" >
7
- <el-input v-model =" oldStr" type =" textarea" :autosize =" {minRows: 2, maxRows: 15}" placeholder =" 请输入旧数据" ></el-input >
7
+ <el-input
8
+ v-model =" oldStr"
9
+ type =" textarea"
10
+ :autosize =" {minRows: 2, maxRows: 15}"
11
+ placeholder =" 请输入旧数据"
12
+ ></el-input >
8
13
</el-form-item >
9
14
</el-col >
10
15
<el-col :span =" 12" >
11
16
<el-form-item label =" 新数据:" >
12
- <el-input v-model =" newStr" type =" textarea" :autosize =" {minRows: 2, maxRows: 15}" placeholder =" 请输入新数据" ></el-input >
17
+ <el-input
18
+ v-model =" newStr"
19
+ type =" textarea"
20
+ :autosize =" {minRows: 2, maxRows: 15}"
21
+ placeholder =" 请输入新数据"
22
+ ></el-input >
13
23
</el-form-item >
14
24
</el-col >
15
25
<el-col :span =" 12" >
16
26
<el-form-item label =" 展示效果:" >
17
- <el-switch v-model =" fotmat" active-text =" line-by-line" inactive-text =" side-by-side" ></el-switch >
27
+ <el-switch
28
+ v-model =" fotmat"
29
+ active-text =" line-by-line"
30
+ inactive-text =" side-by-side"
31
+ ></el-switch >
18
32
</el-form-item >
19
33
</el-col >
20
34
<el-col :span =" 12" >
21
35
<el-form-item label =" 差异化范围:" >
22
- <el-input-number v-model =" context" placeholder =" " ></el-input-number >
36
+ <el-input-number
37
+ v-model =" context"
38
+ placeholder =" "
39
+ ></el-input-number >
23
40
</el-form-item >
24
41
</el-col >
25
42
</el-row >
26
43
</el-form >
27
- <code-diff :old-string =" oldStr" :new-string =" newStr" :context =" context" :output-format =" outputFormat" />
44
+ <code-diff
45
+ :old-string =" oldStr"
46
+ :new-string =" newStr"
47
+ :context =" context"
48
+ :output-format =" outputFormat"
49
+ />
28
50
</div >
29
51
</template >
30
52
31
53
<script >
32
54
import codeDiff from ' ./lib/index.js'
33
- import oldStr from ' ./date/oldStr'
34
- import newStr from ' ./date/newStr'
35
55
export default {
36
56
name: ' App' ,
37
57
components: {
38
58
codeDiff
39
59
},
40
60
data () {
41
61
return {
42
- oldStr,
43
- newStr,
62
+ oldStr: ' ' ,
63
+ newStr: ' ' ,
44
64
fotmat: false ,
45
- context: 5
65
+ context: 10
46
66
}
47
67
},
48
68
computed: {
49
69
outputFormat () {
50
70
return this .fotmat ? ' line-by-line' : ' side-by-side'
51
71
}
72
+ },
73
+ watch: {
74
+ oldStr (v ) {
75
+ localStorage .setItem (' oldStr' , v)
76
+ },
77
+ newStr (v ) {
78
+ localStorage .setItem (' newStr' , v)
79
+ }
80
+ },
81
+ mounted () {
82
+ this .oldStr = localStorage .getItem (' oldStr' )
83
+ this .newStr = localStorage .getItem (' newStr' )
52
84
}
53
85
}
54
86
</script >
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments