File tree 1 file changed +10
-9
lines changed
1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -325,9 +325,15 @@ const stop = useRaf(
325
325
body: newInput ,
326
326
}).then ((res ) => res .text ())
327
327
} catch (error ) {
328
- code = await transformVue (newInput , {
329
- isRem: isChecked .value ,
330
- })
328
+ try {
329
+ code = await transformVue (newInput , {
330
+ isRem: isChecked .value ,
331
+ })
332
+ } catch (e ) {
333
+ // Handle error 弹窗暴露错误消息
334
+ alert (' Error: ' + e )
335
+ return
336
+ }
331
337
}
332
338
333
339
// Properly dispose of the old editor before creating a new one
@@ -451,7 +457,6 @@ function onSelect(value: any) {
451
457
})
452
458
}
453
459
</script >
454
-
455
460
<template >
456
461
<div absolute flex =" ~ gap-2" z-2 left-2 top-5 >
457
462
<div
@@ -512,9 +517,7 @@ function onSelect(value: any) {
512
517
</div >
513
518
<div min-h-20 flex items-center justify-center >
514
519
<div v-if =" transform" flex =" ~ gap-4" items-center >
515
- <div font-bold text =" 18px" >
516
- {{ t('result') }}
517
- </div >
520
+ <div font-bold text =" 18px" >{{ t('result') }}</div >
518
521
<div flex gap-2 items-center break-all >
519
522
{{ transform }}
520
523
<div
@@ -582,7 +585,6 @@ function onSelect(value: any) {
582
585
</h1 >
583
586
<div pb20 data-v-display v-html =" display" />
584
587
</template >
585
-
586
588
<style scoped>
587
589
.textshadow ::after {
588
590
bottom : 0 ;
@@ -598,7 +600,6 @@ function onSelect(value: any) {
598
600
z-index : 1 ;
599
601
}
600
602
</style >
601
-
602
603
<style >
603
604
.ant-select-selector {
604
605
height : 50px !important ;
You can’t perform that action at this time.
0 commit comments