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.
我想设置一个特定节点不可编辑
Transforms.setNodes(editor,{at:[1]},{voids:true})
但它似乎不起作用。有谁知道该怎么做?谢谢!
您需要使用 contentEditable 属性使您的元素呈现为 false contentEditable={false}也可以添加style={{ userSelect: "none" }}以使其不可选择。您可以根据节点道具使其动态化,并使用转换器对其进行设置。
contentEditable={false}
style={{ userSelect: "none" }}