我正在尝试这样做,以便更新和已经存在的节点,但文档并不清楚。
const paht = [0,1,1,2]
const data: any = {
type: 'ref',
id: uniqid(),
data: target,
x: 'new data are here.,',
children: [{text: 'more new data'}],
}
editor.apply({
type: 'update_node_at_path',
path:path,
newProperties: {
node:data,
},
});发布于 2021-11-22 10:03:34
https://docs.slatejs.org/api/transforms -尝试在这里将NodeOptions传递给Transforms.setNodes/任何其他适合您的情况。如果您有特定的路径,则可以将{at: ...}传递给大多数节点转换
https://stackoverflow.com/questions/69835948
复制相似问题