fix(plugin-script): js plugin code format when save (#138)

This commit is contained in:
Hexqi 2023-12-11 14:22:56 +08:00 committed by GitHub
parent af3989a02e
commit 699dc7b77f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@
import { ref, reactive, watchEffect, onActivated, nextTick } from 'vue'
import { useCanvas, useModal, useNotify } from '@opentiny/tiny-engine-controller'
import { string2Ast, ast2String, insertName } from '@opentiny/tiny-engine-common/js/ast'
import { string2Ast, ast2String, insertName, formatString } from '@opentiny/tiny-engine-common/js/ast'
import { constants } from '@opentiny/tiny-engine-utils'
import { getSchema } from '@opentiny/tiny-engine-canvas'
import { lint } from '@opentiny/tiny-engine-common/js/linter'
@ -109,7 +109,7 @@ const saveMethods = () => {
delete declaration.trailingComments
}
const content = ast2String(declaration).trim()
const content = formatString(ast2String(declaration).trim(), 'javascript')
saveMethod({ name, content })
})