@@ -61,7 +61,7 @@ function leftAndRightScroll() {
61
61
}
62
62
63
63
const percentage
64
- = source .scrollTop / (source .scrollHeight - source .offsetHeight )
64
+ = source .scrollTop / (source .scrollHeight - source .offsetHeight )
65
65
const height = percentage * (target .scrollHeight - target .offsetHeight )
66
66
67
67
target .scrollTo (0 , height )
@@ -274,7 +274,7 @@ function mdLocalToRemote() {
274
274
let [, , matchStr] = item
275
275
matchStr = matchStr .replace (/ ^ . \/ / , ` ` ) // 处理 ./img/ 为 img/ 统一相对路径风格
276
276
const { file }
277
- = list .find (f => f .path === ` ${root }${matchStr } ` ) || {}
277
+ = list .find (f => f .path === ` ${root }${matchStr } ` ) || {}
278
278
uploadImage (file ! , (url ) => {
279
279
resolve ({ matchStr , url })
280
280
})
@@ -363,29 +363,18 @@ onMounted(() => {
363
363
364
364
<template >
365
365
<div ref =" container" class =" container flex flex-col" >
366
- <EditorHeader
367
- @add-format =" addFormat"
368
- @format-content =" formatContent"
369
- @start-copy =" startCopy"
370
- @end-copy =" endCopy"
371
- />
366
+ <EditorHeader @add-format =" addFormat" @format-content =" formatContent" @start-copy =" startCopy" @end-copy =" endCopy" />
372
367
<main class =" container-main flex-1" >
373
368
<div class =" container-main-section h-full flex border-1" >
374
369
<PostSlider />
375
370
<div
376
- ref =" codeMirrorWrapper"
377
- class =" codeMirror-wrapper flex-1 border-r-1"
378
- :class =" {
371
+ ref =" codeMirrorWrapper" class =" codeMirror-wrapper flex-1 border-r-1" :class =" {
379
372
'order-1': !store.isEditOnLeft,
380
373
}"
381
374
>
382
375
<ContextMenu >
383
376
<ContextMenuTrigger >
384
- <textarea
385
- id =" editor"
386
- type =" textarea"
387
- placeholder =" Your markdown text here."
388
- />
377
+ <textarea id =" editor" type =" textarea" placeholder =" Your markdown text here." />
389
378
</ContextMenuTrigger >
390
379
<ContextMenuContent class =" w-64" >
391
380
<ContextMenuItem inset @click =" toggleShowUploadImgDialog()" >
@@ -414,12 +403,7 @@ onMounted(() => {
414
403
</ContextMenuContent >
415
404
</ContextMenu >
416
405
</div >
417
- <div
418
- id =" preview"
419
- ref =" preview"
420
- :span =" isShowCssEditor ? 8 : 12"
421
- class =" preview-wrapper flex-1 p-5"
422
- >
406
+ <div id =" preview" ref =" preview" :span =" isShowCssEditor ? 8 : 12" class =" preview-wrapper flex-1 p-5" >
423
407
<div id =" output-wrapper" :class =" { output_night: !backLight }" >
424
408
<div class =" preview border shadow-xl" >
425
409
<section id =" output" v-html =" output" />
@@ -434,35 +418,33 @@ onMounted(() => {
434
418
</div >
435
419
<CssEditor class =" flex-1" />
436
420
</div >
437
- <footer class =" flex flex-1 justify-end pr-5 text-[14px ]" >
438
- 约 {{ readingTime?.words }} 字, {{ readingTime?.text }}
421
+ <footer class =" flex flex-1 justify-end pr-5 text-[12px ]" >
422
+ 字数 {{ readingTime?.words }}, 阅读大约需 {{ Math.ceil( readingTime?.minutes) }} 分钟
439
423
</footer >
440
- </main >
441
424
442
- <UploadImgDialog
443
- @upload-image =" uploadImage"
444
- />
445
-
446
- <InsertFormDialog />
447
-
448
- <RunLoading />
449
-
450
- <AlertDialog v-model:open =" store.isOpenConfirmDialog" >
451
- <AlertDialogContent >
452
- <AlertDialogHeader >
453
- <AlertDialogTitle >提示</AlertDialogTitle >
454
- <AlertDialogDescription >
455
- 此操作将丢失本地自定义样式,是否继续?
456
- </AlertDialogDescription >
457
- </AlertDialogHeader >
458
- <AlertDialogFooter >
459
- <AlertDialogCancel >取消</AlertDialogCancel >
460
- <AlertDialogAction @click =" store.resetStyle()" >
461
- 确认
462
- </AlertDialogAction >
463
- </AlertDialogFooter >
464
- </AlertDialogContent >
465
- </AlertDialog >
425
+ <UploadImgDialog @upload-image =" uploadImage" />
426
+
427
+ <InsertFormDialog />
428
+
429
+ <RunLoading />
430
+
431
+ <AlertDialog v-model:open =" store.isOpenConfirmDialog" >
432
+ <AlertDialogContent >
433
+ <AlertDialogHeader >
434
+ <AlertDialogTitle >提示</AlertDialogTitle >
435
+ <AlertDialogDescription >
436
+ 此操作将丢失本地自定义样式,是否继续?
437
+ </AlertDialogDescription >
438
+ </AlertDialogHeader >
439
+ <AlertDialogFooter >
440
+ <AlertDialogCancel >取消</AlertDialogCancel >
441
+ <AlertDialogAction @click =" store.resetStyle()" >
442
+ 确认
443
+ </AlertDialogAction >
444
+ </AlertDialogFooter >
445
+ </AlertDialogContent >
446
+ </AlertDialog >
447
+ </main >
466
448
</div >
467
449
</template >
468
450
0 commit comments