如何重置Codemirror编辑器? [英] How to reset Codemirror editor?

查看:156
本文介绍了如何重置Codemirror编辑器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想重置Codemirror编辑器的所有内容。理想情况下,这应该清除文本区域,删除所有标记并清除历史记录。

I would like to reset all the contents of the Codemirror editor. Ideally, this should clear the textarea, remove all marks and clear the history.

实现此目的的最佳方法是什么?

What's the best way to achieve this?

推荐答案

cm.setValue("");
cm.clearHistory();
// cm.clearGutter("gutterId"); if you have gutters

这篇关于如何重置Codemirror编辑器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆