Кнопки панели инструментов не отображаются в нашем приложении React, созданном facebook / create-реагировать-app.
Я попытался импортировать файлы JS и CSS в src / index.tsx или справа до того, где компонент используется. Я также попытался импортировать отдельные плагины. Ни один из них не работает.
// Froala Editor JS files.
import 'froala-editor/js/froala_editor.pkgd.min.js';
import 'froala-editor/js/plugins.pkgd.min.js';
// Froala Editor CSS files.
import 'froala-editor/css/froala_style.min.css';
import 'froala-editor/css/froala_editor.pkgd.min.css';
import 'froala-editor/css/plugins.pkgd.min.css';
// Froala requires Font Awesome.
import 'font-awesome/css/font-awesome.css';
Вот как я устанавливаю параметры. Я даже пытался установить только кнопки выравнивания, но это не работает.
<FroalaEditor
model={model}
onModelChange={onModelChange}
config={{
key: FROALA_KEY,
attribution: false,
toolbarButtons: {
moreText: {
buttons: [
'bold',
'italic',
'underline',
'strikeThrough',
'subscript',
'superscript',
'fontFamily',
'fontSize',
'textColor',
'backgroundColor',
'inlineClass',
'inlineStyle',
'clearFormatting',
],
align: 'left',
buttonsVisible: 3,
},
moreParagraph: {
buttons: [
'alignLeft',
'alignCenter',
'formatOLSimple',
'alignRight',
'alignJustify',
'formatOL',
'formatUL',
'paragraphFormat',
'paragraphStyle',
'lineHeight',
'outdent',
'indent',
'quote',
],
align: 'left',
buttonsVisible: 3,
},
moreRich: {
buttons: [
'insertLink',
'insertImage',
'insertVideo',
'insertTable',
'emoticons',
'fontAwesome',
'specialCharacters',
'embedly',
'insertFile',
'insertHR',
],
align: 'left',
buttonsVisible: 3,
},
moreMisc: {
buttons: [
'undo',
'redo',
'fullscreen',
'print',
'getPDF',
'spellChecker',
'selectAll',
'html',
'help',
],
align: 'right',
buttonsVisible: 2,
},
},
...config,
}}
/>
Я вижу эти кнопки только в интерфейсе, независимо от того, как я настроил параметры. ![enter image description here](https://i.stack.imgur.com/k4cZm.png)