【问题标题】:summernote not well setupSummernote 设置不好
【发布时间】:2019-11-24 22:48:02
【问题描述】:

您好,我在我的 laravel 项目中使用 Summernote,一切正常,除了在创建和编辑视图中,页面顶部有不必要的 bar ()。 我的代码如下:

设置:

 <link rel="stylesheet" href="{{asset('assets/js/vendor/summernote/dist/summernote.css')}}">
 <script src="{{asset('assets/js/vendor/summernote/dist/summernote.js')}}"></script>

html:

 <textarea class="form-control summernote"
                  name="special_notes" id="special_notes"
                  placeholder="Enter special notes here...">
            {{ old('special_notes', optional($tblProperty)->special_notes) }}</textarea>

脚本:

$(document).ready(function() {

        $('.summernote').summernote({

            height:300,

        });

    });

不必要的吧:

【问题讨论】:

    标签: jquery html laravel summernote


    【解决方案1】:

    在您的 Javascript 代码中尝试:

    $('.summernote').summernote({
            height:300,
            toolbar: []
        });
    

    上面的代码应该删除summernote的每个工具栏。

    如果您想自定义工具栏以使用特定元素,则可以使用您需要的元素填充 toolbar 数组:

    来源:https://summernote.org/deep-dive/

    【讨论】:

    • 它是否完全删除了summernote的任何工具栏?使用上面的代码你应该看不到任何工具栏按钮
    • 它删除了除我提到的工具栏之外的所有工具栏
    • github.com/summernote/summernote/issues/2516 这是一个已知问题。刚刚也搜了一下。看看这里
    【解决方案2】:

    我通过编辑添加 css 样式的第 170 行更新了 summernote.js: 样式=“显示:无!重要;”这解决了我的问题。

    这条线变成了: '',

    我关注了链接上的评论:https://github.com/summernote/summernote/issues/2516

    【讨论】:

      猜你喜欢
      • 2022-01-12
      • 2017-04-09
      • 2018-02-16
      • 2017-08-11
      • 2014-12-19
      • 2015-02-16
      • 2021-01-26
      • 2019-09-24
      • 2016-12-08
      相关资源
      最近更新 更多