Skip to content

Commit 2a854fc

Browse files
committed
增加代码格式化
1 parent 20b6b75 commit 2a854fc

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
2. 优化补全自动空格
77
3. 更全的工作区支持
88

9+
## 新增
10+
11+
1. 增加代码格式化
12+
913
# 2.1.3
1014

1115
## 新增

iframe/main/index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<div id="app">
1313
<div id="sidebar">
1414
<ul>
15+
<li><button id="formatEditorCode-btn">代码格式化</button></li>
1516
<li><button id="run-btn">运行</button></li>
1617
<li><button id="import-btn">导入</button></li>
1718
<li><button id="export-btn">导出</button></li>
@@ -44,7 +45,7 @@
4445
<script src="/iframe/script/Js_beautify/beautify-css.min.js"></script>
4546
<script src="/iframe/script/Js_beautify/beautify.min.js"></script>
4647
<script src="/iframe/script/Js_beautify/beautify-html.min.js"></script>
47-
<script src="/iframe"></script>
48+
<!-- <script src="/iframe"></script> -->
4849
<!-- 以下全都是ACE的风格文件,如果有需要可以自己添加 东西都在Ace_Editor文件夹里-->
4950
<script src="/iframe/script/Ace_Editor/theme-monokai.js"></script>
5051
<script src="/iframe/script/Ace_Editor/theme-github.js"></script>
@@ -92,6 +93,10 @@
9293
document.getElementById('SaveinLeft-btn').addEventListener('click', () => {
9394
Code_SaveToBtnList(editor);
9495
});
96+
//格式化代码
97+
document.getElementById('formatEditorCode-btn').addEventListener('click', () => {
98+
formatEditorCode(editor);
99+
});
95100
// 运行代码
96101
document.getElementById('run-btn').addEventListener('click', () => {
97102
ACE_RunCode(editor);

0 commit comments

Comments
 (0)