简体   繁体   English

Summernote Bold 风格不适用于 Angular 应用程序

[英]Summernote Bold style not working in angular application

I am using Summernote in my angular application.我在我的 Angular 应用程序中使用 Summernote。 I have imported CSS as well as JS.我已经导入了 CSS 和 JS。

   "./node_modules/summernote/dist/summernote-lite.min.css"
      "node_modules/summernote/dist/summernote-lite.min.js"

I have initialised the Summernote in my component.我已经在我的组件中初始化了 Summernote。

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

Everything works fine other than the Bold function.除了粗体功能外,一切正常。 The problem is if I write some text inside the text field and select all the text and click Bold icon on toolbar or click ctrl+B on keyboard, nothing happens.问题是,如果我在文本字段中写入一些文本并选择所有文本并单击工具栏上的粗体图标或单击键盘上的 ctrl+B,则没有任何反应。 But if I select a substring of that text and click B button, then it becomes bold.但是,如果我选择该文本的子字符串并单击 B 按钮,则它会变为粗体。 在此处查看图片。

If I toggle B button and start writing, then text will be written in Bold.如果我切换 B 按钮并开始书写,那么文本将以粗体书写。 What am I missing ?我错过了什么?

I tried "node_modules/summernote/dist/summernote-bs5.min.js" and respective CSS and bs4 and respective CSS as well.我尝试"node_modules/summernote/dist/summernote-bs5.min.js"以及各自的CSS和bs4以及各自的CSS。

Check the styles applied for HTML element "paragraph".检查应用于 HTML 元素“段落”的样式。 Some other styles might be overriding it.其他一些样式可能会覆盖它。 This usually happens if we have applied styles on the body or which are across the entire application.如果我们在主体上应用了样式或在整个应用程序中应用了样式,通常会发生这种情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM