【发布时间】:2019-10-19 17:10:52
【问题描述】:
我目前正在使用 Summernote,它在我的整个应用程序中运行良好,但是我遇到了一个小问题,我在一页中有 2 个特色。我发现第二个编辑器中的占位符继承了第一个编辑器的占位符。有没有一种简单的方法来解决这个问题,而无需创建 wysiwyg-editor1 和 wysiwyg-editor2?
editor = $('[data-toggle="wysiwyg-editor"]');
default_options = {
minHeight: 400,
styleTags: ['p', 'h1', 'h2', 'h3',],
toolbar: [
['cleaner', ['cleaner']],
['insert', ['table', 'link']],
['style', ['bold', 'italic', 'underline', 'clear']],
['font', ['strikethrough', 'superscript', 'subscript']],
['para', ['ul', 'ol']]
],
placeholder: $(editor).attr('placeholder'),
cleaner:{
action: 'paste',
newline: '<p></p>',
keepClasses: true
},
prettifyHtml: true,
disableDragAndDrop: true,
};
editor.summernote(default_options);
<textarea data-toggle="wysiwyg-editor" name="intro" placeholder="Provide an introduction"></textarea>
<textarea data-toggle="wysiwyg-editor" name="description" placeholder="Provide a description"></textarea>
【问题讨论】:
标签: jquery html bootstrap-4 editor summernote