Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
function onkeydown(e) { if (e.key === "enter") e.preventDefault() } <ReactQuill onKeyDown={onkeydown}/>
这里我无法阻止输入键。
你要找的是这个。
function onkeydown(e) { if (e.keyCode === 13) e.preventDefault() }
由于Enter按键事件的 keyCode 是13 }
Enter
13