Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to control the display of functions in toolbar by declaring command? #221

Closed
goudanz opened this issue Aug 9, 2021 · 3 comments
Closed

Comments

@goudanz
Copy link

goudanz commented Aug 9, 2021

I want to do this.

eg:

const commands = ['bold','codeBlock','link','code','image'];

When I set this up, only these are displayed in the toolbar!

@goudanz
Copy link
Author

goudanz commented Aug 9, 2021

like this:

https://braft.margox.cn/demos/custom



    const controls = [
        'undo', 'redo', 'headings', 'separator','text-color', 'bold', 'separator', 'text-indent', 'text-align', 'separator',
        'list-ul', 'list-ol', 'blockquote', 'code', 'separator','link', 'media', 'separator','clear'
    ]


<BraftEditor
        style={{border: '1px solid #d1d1d1',borderRadius: '2px',height: 400}}
        contentStyle={{height: 306, overflowY: 'scroll'}}
        controls={controls}
        extendControls={extendControls}
        value={editor}
        defaultValue={defaultValue}
        media={{uploadFn: myUploadFn}}
        onChange={onEditorContentChange}
        onFocus={onFocus}
    />

@goudanz
Copy link
Author

goudanz commented Aug 9, 2021

thanks,I know the solution.

@goudanz
Copy link
Author

goudanz commented Aug 9, 2021

i found the way from here : #213 (comment)

@goudanz goudanz closed this as completed Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant