Explorar o código

查找 node 依照 id

visuddhinanda %!s(int64=2) %!d(string=hai) anos
pai
achega
a8592b83cc
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      dashboard/src/components/article/EditableTree.tsx

+ 1 - 1
dashboard/src/components/article/EditableTree.tsx

@@ -172,7 +172,7 @@ const EditableTreeWidget = ({
     }
     const update = (_node: TreeNodeData[]) => {
       _node.forEach((value, index, array) => {
-        if (value.key === updatedNode.key) {
+        if (value.id === updatedNode.id) {
           array[index].title = updatedNode.title;
           console.log("key found");
           return;