How to create undo/redo buttons in Quill JS (react-quill)?

前端 未结 4 2033
傲寒
傲寒 2021-01-06 15:52

QuillJS doesn\'t come with default undo/redo buttons. I\'m trying to add them to the toolbar. Quill has a folder with the undo/redo icons saved. In the node_modules, there\'

4条回答
  •  独厮守ぢ
    2021-01-06 15:59

    Does anyone know exactly what code I would need to write and where in order to add undo/redo icons to the toolbar that are connected to the undo/redo functions build into Quill?

    Hi. Unfortunately I still don't know how to connect buttons to native Quill functions. But you can do something else that can give you the desired result.

    Take a look at this. Search for items 020, 021 and 026.

    You can add a new button, and set it to call the following code:

    quill.history.undo();
    

    History Module

    If you have additional questions, please leave a comment. As soon as I can, I will answer you.

提交回复
热议问题