@@ -13,6 +13,7 @@ const formState = reactive({
1313 trim: false ,
1414 noDiffLineFeed: false ,
1515 filename: ' package.json' ,
16+ newFilename: ' newPackage.json' ,
1617 hideHeader: false ,
1718 hideStat: false ,
1819})
@@ -59,12 +60,18 @@ function printEvent(e) {
5960 <a-button ><a href =" https://github.com/Shimada666/v-code-diff" >View on Github</a ></a-button >
6061 </div >
6162 <div style =" display : flex ; justify-content : space-between ;" >
62- <textarea v-model =" oldString" style =" width : 48vw ; margin-right : 10px ;" :rows =" 20" />
63- <textarea v-model =" newString" style =" width : 48vw ;" :rows =" 20" />
63+ <div style =" margin-right : 5px ;" >
64+ <a-input v-model:value =" formState.filename" />
65+ <textarea v-model =" oldString" style =" width : 48vw ;" :rows =" 20" />
66+ </div >
67+ <div >
68+ <a-input v-model:value =" formState.newFilename" />
69+ <textarea v-model =" newString" style =" width : 48vw ;" :rows =" 20" />
70+ </div >
71+
6472 </div >
6573 <div style =" margin-top : 10px ;" >
66- <a-button style =" margin-right : 5px ;"
67- @click =" resetText" >
74+ <a-button style =" margin-right : 5px ;" @click =" resetText" >
6875 重置文本(reset text)
6976 </a-button >
7077 <a-button type =" default" @click =" clearText" >
@@ -152,8 +159,8 @@ function printEvent(e) {
152159 <div >
153160 <CodeDiff :theme =" formState.theme" :old-string =" oldString" :new-string =" newString" :language =" formState.language"
154161 :diff-style =" formState.diffStyle" :output-format =" formState.outputFormat" :context =" formState.context"
155- :trim =" formState.trim" :no-diff-line-feed =" formState.noDiffLineFeed" filename =" File Name "
156- new-filename =" New File Name " :hide-header =" formState.hideHeader" :hide-stat =" formState.hideStat"
162+ :trim =" formState.trim" :no-diff-line-feed =" formState.noDiffLineFeed" : filename =" formState.filename "
163+ : new-filename =" formState.newFilename " :hide-header =" formState.hideHeader" :hide-stat =" formState.hideStat"
157164 @diff =" printEvent" />
158165 </div >
159166 </div >
0 commit comments