【问题标题】:Summernote Toolbar customization IssueSummernote 工具栏自定义问题
【发布时间】:2016-09-16 22:24:26
【问题描述】:

我正在尝试从 Summernote 编辑器工具栏中删除一些功能。但是当我编写以下代码来自定义它时,

$('.summernote').summernote({

  toolbar: [
    // [groupName, [list of button]]
    ['style', ['bold', 'italic', 'underline', 'clear']],
    ['font', ['strikethrough', 'superscript', 'subscript']],
    ['fontsize', ['fontsize']],
    ['color', ['color']],
    ['para', ['ul', 'ol', 'paragraph']],
    ['height', ['height']]
  ]
});

它在控制台(开发人员工具)中给出以下错误并且工具栏消失(由于错误)。

Uncaught TypeError: b[t[1][u]] is not a function

【问题讨论】:

    标签: javascript twitter-bootstrap custom-controls summernote


    【解决方案1】:

    是的,看起来您使用的是其他版本的 Summernote。升级到最新版本,它应该可以工作:(示例)https://jsfiddle.net/ggfk1h3x/

    jquery/1.9.1
    bootstrap/3.3.6
    summernote/0.8.1
    

    【讨论】:

      【解决方案2】:

      我遇到了同样的问题!我的问题是因为简单的 ' 。 我把它改成了“”

      $('#summernote').summernote({
          toolbar: [
            ["style", ["bold", "italic", "underline", "clear"]]
            ["font", ["strikethrough", "superscript", "subscript"]]
            ["fontsize", ["fontsize"]]
            ["color", ["color"]]
            ["para", ["ul", "ol", "paragraph"]]
            ["height", ["height"]]
          ]
      });
      

      它就像一个魅力!

      【讨论】:

        猜你喜欢
        • 2015-05-02
        • 1970-01-01
        • 2017-05-28
        • 2015-10-31
        • 2015-01-05
        • 1970-01-01
        • 2020-12-11
        • 2019-09-26
        • 2018-09-04
        相关资源
        最近更新 更多