CKEditor 5 and ReactJS: I can't edit the toolbar

前端 未结 1 885
情话喂你
情话喂你 2021-01-16 13:39

I\'m reading the documentation (link) but I\'m not sure about how to edit the toolbar. This is the editor component:

import React, { Component } from \'react         


        
相关标签:
1条回答
  • 2021-01-16 13:52

    Pass the configuration straight into the config property:

    <CKEditor
        editor={ this.state.editor }
        data={this.state.content}
        // ...
        config={
            toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote' ],
            heading: {
                options: [
                    { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
                    { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
                    { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }
                ]
            }
        }
        // ...
    />
    
    0 讨论(0)
提交回复
热议问题