是否可以使 onClick 事件等于 keyCodes 的组合?我正在尝试制作一个撤消按钮。我想要的是按钮的 onClick 事件等于按下“Command-Z”或“Ctrl-Z”。
我无法从头开始创建撤消功能。我正在使用 QuillJS。撤消功能已经使用 keydown 方法内置到程序中。但是程序中没有内置撤消按钮。我正在尝试创建一个激活 undo keydown 事件。
是否可以使 onClick 事件等于 keyCodes 的组合?我正在尝试制作一个撤消按钮。我想要的是按钮的 onClick 事件等于按下“Command-Z”或“Ctrl-Z”。
我无法从头开始创建撤消功能。我正在使用 QuillJS。撤消功能已经使用 keydown 方法内置到程序中。但是程序中没有内置撤消按钮。我正在尝试创建一个激活 undo keydown 事件。
When the button is pressed, call the function:
quill.history.undo();
Check out the docs at https://quilljs.com/docs/modules/history/
Answering your question directly, there is no way to trick the quilljs editor into thinking that you pressed control+z in this way.