Summernote 所见即所得:将代码视图设置为默认视图 [英] Summernote WYSIWYG : set code view as default view

查看:35
本文介绍了Summernote 所见即所得:将代码视图设置为默认视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网上找不到任何关于此的信息.有没有办法将 Summernote(所见即所得 jQuery 文本编辑器)的默认视图设置为代码/html 视图.我想在登陆表单页面时直接看到HTML代码.

I can't find anything about this on the web. Is there a way to set the default view of Summernote (WYSIWYG jQuery text editor) to be the code/html view. I want to see directly the HTML code when landing on the form page.

谢谢

推荐答案

你可以模拟点击codeview按钮(在summernote初始化之后),对我有用:

You can simulate a click on the codeview button (after summernote initialization), it works for me :

$('.summernote').summernote({
     oninit: function() {
         $("div.note-editor button[data-event='codeview']").click();
     }
});

这篇关于Summernote 所见即所得:将代码视图设置为默认视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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