Tiy-editor是和jsFiddle一样具有在线运行js功能的在线代码编辑器,基于Ace。
Demo:https://lipte.lik/demo/editor
Usage1.下载slidePage
git cloe https://github.com/lipte/Tiy-editor.git2.引用相关文件
<lik rel="stylesheet" href="Tiy-editor.css"/>3.引用js文件
<script src="https://cd.bootcss.com/ace/1.2.3/ace.js" type="text/javascript" charset="utf-8"></script><script type="text/javascript" src="Tiy-editor.js"></script>4.html结构
//--html结构比较复杂,看下载后的editor.html比较完整5.初始化代码
var Tiy = ew TiyEditor()MethodTiy.tab(um)
tab显示第几个面板,um传序号,从1开始
Tiy.ru()
运行结果并跳到result面板
Tiy.save()
保存代码至缓存
Tiy.fullScree()
全屏模式开启或关闭
Tiy.dockMode()
dock边栏模式开启或关闭
Tiy.liveMode()
实时运行模式,发生chage事件时执行一次,仅开启dock模式的前提下才能开启










评论