File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,6 +110,18 @@ async function onFileChange(newFile: File | null | undefined) {
110110 imageFile .value = newFile
111111 await runOCR (imageFile .value )
112112 format ()
113+ if (auto_copy_value .value ) {
114+ switch (auto_copy_value .value ) {
115+ case ' typst' :
116+ copyAsTypst ()
117+ break
118+ case ' latex' :
119+ copy ()
120+ break
121+ default :
122+ copy (auto_copy_value .value )
123+ }
124+ }
113125 }
114126}
115127
@@ -163,6 +175,10 @@ const handlePaste = async (event: ClipboardEvent) => {
163175 }
164176}
165177
178+ // auto copy
179+ const auto_copy_items = ref ([' latex' , ' typst' , ... wrap_format_options ])
180+ const auto_copy_value = ref (null )
181+
166182let load: (model_config : ModelConfig ) => Promise <void >
167183let runOCR: (imageFile : File ) => Promise <void >
168184
@@ -410,6 +426,16 @@ onBeforeUnmount(() => {
410426 {{ t('copyAs') + ' ' + t('typstCode') }}
411427 </UButton >
412428 </div >
429+ <div class =" flex" >
430+ <USelect
431+ v-model =" auto_copy_value "
432+ :items =" auto_copy_items "
433+ :placeholder =" t (' autoCopy' )"
434+ :ui =" {
435+ content: ' w-auto'
436+ } "
437+ />
438+ </div >
413439 </div >
414440 </template >
415441 </UCard >
Original file line number Diff line number Diff line change 2626 "typstCode" : " Typst" ,
2727 "convert_to" : " Convert to " ,
2828 "failed" : " failed" ,
29+ "autoCopy" : " Auto copy" ,
2930 "comment_welcome" : " Wanna say something to the developer or the users?" ,
3031 "report_issue" : " Encounter an issue? Report here!" ,
3132 "load_model_from" : " Load model from" ,
Original file line number Diff line number Diff line change 2626 "typstCode" : " Typst" ,
2727 "convert_to" : " 转换为" ,
2828 "failed" : " 失败" ,
29+ "autoCopy" : " 自动复制" ,
2930 "comment_welcome" : " 想对开发者或用户说点什么?" ,
3031 "report_issue" : " 遇到问题?点我反馈!" ,
3132 "load_model_from" : " 加载模型自" ,
You can’t perform that action at this time.
0 commit comments