提交 6fd03f8e 编写于 作者: B baiy 提交者: ninecents

格式化代码优化 #79

上级 aadbbb28
......@@ -115,5 +115,6 @@ npm run build -adapter=[chrome|edge|utools|firefox|web]
- [jwt-decode](https://www.npmjs.com/package/jwt-decode)
- [jian_fan](https://www.npmjs.com/package/jian_fan)
- [axios](https://www.npmjs.com/package/axios)
- [monaco-editor](https://www.npmjs.com/package/monaco-editor)
> 当然项目中还使用很多不知道姓名的大神的代码, 在这里就不一一感谢
......@@ -16,10 +16,18 @@
</ButtonGroup>
</FormItem>
<FormItem>
<Select placeholder="更多语言/格式" @on-change="(value)=>{handle(value)}">
<Select placeholder="更多语言" @on-change="(value)=>{handle(value)}">
<Option v-for="item in lang" :value="item" :key="item">{{ item }}</Option>
</Select>
</FormItem>
<FormItem>
<Select placeholder="代码缩进" v-model="current.tab">
<Option :value="2">缩进 Tab 2</Option>
<Option :value="4">缩进 Tab 4</Option>
<Option :value="6">缩进 Tab 6</Option>
<Option :value="8">缩进 Tab 8</Option>
</Select>
</FormItem>
</option-block>
</div>
</template>
......@@ -47,7 +55,7 @@ export default {
if (this.current.content) {
try {
this.current.lang = language;
this.$refs.editor.format(language);
this.$refs.editor.format(language,{tab:this.current.tab});
this.$saveToolData(this.current);
return this.$Message.success('格式化完成');
}
......@@ -65,6 +73,7 @@ export default {
current: {
content: "",
lang: "",
tab:4,
},
lang: [
"html",
......@@ -82,6 +91,7 @@ export default {
"graphql",
"markdown",
"vue",
"angular",
],
};
},
......
......@@ -21,6 +21,7 @@ const allowFormatterLanguage = {
xml: "xml",
yaml: "yaml",
vue: "vue",
angular: "angular",
}
export default {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册