1 Star 3 Fork 1

hoyin2020 / ace_editor_sql_formatter

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

ace_demo

  1. https://yq.aliyun.com/articles/65260
  2. http://m.poorren.com/ace-editor-code-editor-guide
  3. http://blog.csdn.net/sd4015700/article/details/49910353
  • ace editor 术语:
术语 含义
snippet 代码片段(在自动补全时使用)
gutter 行数所在的位置
  • 以下部分是设置输入代码提示的,如果不需要可以不用引用ext-language_tools.js。
    ace.require("ace/ext/language_tools");
    editor.setOptions({
        enableBasicAutocompletion: true,
        enableSnippets: true,
        enableLiveAutocompletion: true,
        // 用户输入的sql语句,自动换行
        wrap: true
    });
//获取内容
editor.getValue();
//设置内容
editor.setValue(value);
//用户选中的内容
editor.session.getTextRange(editor.getSelectionRange())
// 设置打印线是否显示
editor.setShowPrintMargin(false);
// 设置是否只读
editor.setReadOnly(true);
// 获取总行数: 
editor.session.getLength()
// 在光标处插入字符串:
editor.insert("Something cool");
// 选中的代码部分
editor.session.getTextRange(editor.getSelectionRange());
// 获取当前光标所在的行和列
editor.selection.getCursor();
    <!--编辑器的最主要文件-->
    <script src="http://cdn.bootcss.com/ace/1.2.9/ace.js"></script>
    <!--用来提供代码提示和自动补全的插件-->
    <script src="http://cdn.bootcss.com/ace/1.2.9/ext-language_tools.js"></script>
    <!--兼容旧版本IE-->
    <script src="http://cdn.bootcss.com/ace/1.2.9/ext-old_ie.js"></script>
    <!--编辑器的主题插件-->
    <script src="http://cdn.bootcss.com/ace/1.2.9/theme-monokai.js"></script>
    <!--sql模式-->
    <script src="https://cdn.bootcss.com/ace/1.2.9/mode-sql.js"></script>

A Vue.js project

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

For a detailed explanation on how things work, check out the guide and docs for vue-loader.

空文件

简介

ace editor 结合 sql-formatter,实现sql的录入和格式化。官方地址:https://ace.c9.io/ 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/hoyin2020/ace_editor_sql_formatter.git
git@gitee.com:hoyin2020/ace_editor_sql_formatter.git
hoyin2020
ace_editor_sql_formatter
ace_editor_sql_formatter
master

搜索帮助