1
0
mirror of https://github.com/sahadev/vue-component-creater-ui.git synced 2025-09-28 07:13:21 +08:00

feat: 支持单文件二次编辑

This commit is contained in:
shangbin
2021-11-16 19:58:28 +08:00
parent 4cde9098bc
commit 2f4b143550
8 changed files with 139 additions and 19 deletions

View File

@@ -84,11 +84,16 @@ export default {
},
computed: {
prettyCode() {
return prettier.format(this.rawCode, {
parser: "html",
plugins: [parserHtml],
vueIndentScriptAndStyle: true,
});
try {
return prettier.format(this.rawCode, {
parser: "html",
plugins: [parserHtml],
vueIndentScriptAndStyle: true,
});
} catch (error) {
return this.rawCode;
}
},
formatCode() {