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.
我正在使用 slate.js 和 React.js 创建一个基本编辑器。
当我单击编辑器外部的卡片时,我想在当前选定位置在编辑器内插入文本,即当我单击包含文本的卡片时,文本上的卡片应插入到 slate.js 编辑器中的最后一个光标位置。
您不需要获取光标位置。当您单击按钮时,Slate 会记住选择。您只需要插入内容:
editor.insertBlock(...)