66import type { ModeSpec , ModeSpecOptions } from ' codemirror'
77import { ref , onMounted , watchEffect , inject } from ' vue'
88import prettier from ' prettier/standalone'
9- import parserBabel from ' prettier/parser- babel'
10- import parserHtml from ' prettier/parser- html'
11- import parserPostcss from ' prettier/parser- postcss'
9+ import parserBabel from ' prettier/plugins/ babel'
10+ import parserHtml from ' prettier/plugins/ html'
11+ import parserPostcss from ' prettier/plugins/ postcss'
1212import { debounce } from ' ../utils'
1313import CodeMirror from ' ./codemirror'
1414
@@ -65,7 +65,7 @@ onMounted(() => {
6565 emit (' change' , editor .getValue ())
6666 })
6767
68- editor .on (' blur' , () => {
68+ editor .on (' blur' , async () => {
6969 const parser = props .extension === ' vue' ? ' html'
7070 : props .extension === ' html' ? ' html'
7171 : props .extension === ' css' ? ' css'
@@ -83,7 +83,7 @@ onMounted(() => {
8383
8484 let code = editor .getValue ()
8585 try {
86- code = prettier .format (code , options )
86+ code = await prettier .format (code , options )
8787 } catch (err ) {}
8888
8989 emit (' change' , code )
0 commit comments