随笔分类 -  富文本编辑器

摘要:根据逻辑和需求选择适合自己的方法 1.可以考虑使用pre标签 2.可以使用正则表达式,例如我想在有。和!的地方进行换行,例如: <script type="text/javascript"> var description = '<p style="margin-top:19.5pt;margin- 阅读全文
posted @ 2020-05-11 17:18 阿蒙不萌 阅读(12687) 评论(0) 推荐(0) 编辑
摘要:获取 JSON 格式的内容 可以通过editor.txt.getJSON获取 JSON 格式的编辑器的内容,v3.0.14开始支持,示例如下 如果编辑器区域的 html 内容是如下: 那么获取的 JSON 格式就如下: 阅读全文
posted @ 2019-09-12 16:48 阿蒙不萌 阅读(2003) 评论(0) 推荐(0) 编辑
摘要:使用 textarea wangEditor 从v3版本开始不支持 textarea ,但是可以通过onchange来实现 textarea 中提交富文本内容。 阅读全文
posted @ 2019-09-12 16:47 阿蒙不萌 阅读(4490) 评论(0) 推荐(0) 编辑
摘要:设置内容 以下方式中,如果条件允许,尽量使用第一种方式,效率最高。 html 初始化内容 直接将内容写到要创建编辑器的<div>标签中 js 设置内容 创建编辑器之后,使用editor.txt.html(...)设置编辑器内容 追加内容 创建编辑器之后,可使用editor.txt.append('< 阅读全文
posted @ 2019-09-12 16:24 阿蒙不萌 阅读(5839) 评论(0) 推荐(0) 编辑
摘要:// 禁用编辑功能 editor.$textElem.attr('contenteditable', false) // 开启编辑功能 editor.$textElem.attr('contenteditable', true) 阅读全文
posted @ 2019-09-12 15:43 阿蒙不萌 阅读(2311) 评论(0) 推荐(0) 编辑
摘要:###~css .toolbar { border: 1px solid #ccc; } .text { border: 1px solid #ccc; height: 400px; } #div3{ margin-top: 50px } ###~vue <template> <div class= 阅读全文
posted @ 2019-09-12 15:42 阿蒙不萌 阅读(1019) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/Taurus_0811/article/details/103787510 wangEditor —— 轻量级 web 富文本编辑器,配置方便,使用简单。支持 IE10+ 浏览器。 官网:www.wangEditor.com 文档:www.kancloud 阅读全文
posted @ 2019-09-12 14:59 阿蒙不萌 阅读(2203) 评论(1) 推荐(0) 编辑

点击右上角即可分享
微信分享提示