简体   繁体   English

froala 没有显示一些工具栏按钮

[英]froala not showing some toolbar buttons

Froala doesn't want show some buttons (like: video, image, table ...) and I don't now why. Froala 不想显示一些按钮(例如:视频、图像、表格......),我现在不知道为什么。 Maybe I just forget add some script?也许我只是忘记添加一些脚本? This My options:这是我的选择:

    public tb = [
        "bold", "italic" , "insertTable","insertImage"]; 
 public options: Object = { 
  placeholderText: 'Edit Your Content Here!',
  toolbarInline: false,
  toolbarButtons: this.tb,
        toolbarButtonsMD: this.tb,
        toolbarButtonsSM: this.tb,
        toolbarButtonsXS: this.tb
}

This My scripts:这是我的脚本:

<script src="http://code.jquery.com/jquery-1.9.0.js"></script>
  <script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
  <script src="bower_components/froala-wysiwyg-editor/js/froala_editor.min.js"></script>
<script src="bower_components/froala-wysiwyg-editor/js/plugins/image.min.js"></script>
  <script src="bower_components/froala-wysiwyg-editor/js/plugins/image_manager.min.js"></script>
<script src="bower_components/froala-wysiwyg-editor/js/plugins/video.min.js"></script>

And My client just show Bold and Italic, how can I fix it?我的客户只显示粗体和斜体,我该如何解决?

在此处输入图像描述

Make sure you also have the css counterparts. 确保你也有css对应物。 Like plugins/image.min.css plugins/image.min.css

Here's the list 这是清单

Froala version 2 requires Font Awesome (as well as jQuery). Froala 版本 2 需要 Font Awesome(以及 jQuery)。 You need to include the font-awesome CSS file, eg through a CDN, to have the buttons in the toolbar visible:您需要包含字体很棒的 CSS 文件,例如通过 CDN,以使工具栏中的按钮可见:

<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">

To add buttons that require Plugins:添加需要插件的按钮:

1.package.json 1.package.json

  "dependencies": {
     . . .
     "angular-froala-wysiwyg": "4.0.8",
  1. Add import of plugins for your button in app.module.ts在 app.module.ts 中为您的按钮添加插件导入

For example for fullscreen button:例如对于全屏按钮:

import 'froala-editor/js/plugins/fullscreen.min.js';
import 'froala-editor/js/plugins/code_view.min.js';

import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';

@NgModule({
...
imports: [FroalaEditorModule.forRoot(), FroalaViewModule.forRoot() ... ],
... 
  1. Add in your angular.json (I am using styles.scss)添加你的 angular.json(我使用的是 styles.scss)

     "styles": [ "src/styles.scss", "node_modules/froala-editor/css/froala_editor.pkgd.min.css", "node_modules/froala-editor/css/froala_style.min.css" ], "scripts": [ "node_modules/froala-editor/js/froala_editor.pkgd.min.js" ]

4.app.module.ts 4.app.module.ts

<div [froalaEditor]>Hello, Froala!</div>
  1. You will see a fullscreen button:您将看到一个全屏按钮: 在此处输入图像描述

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

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