Selaa lähdekoodia

节点data修改

tangjunhao 3 kuukautta sitten
vanhempi
säilyke
b8c1fff02c
1 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  1. 5 0
      src/views/model/vueflow/index.vue

+ 5 - 0
src/views/model/vueflow/index.vue

@@ -257,6 +257,11 @@ onConnect(async (connection) => {
       // 创建 comID 为 3 的中间组件
       const npcId = await createCom3(pid.value);
 
+      const pointNode = nodes.value.find(n => n.id === pointNodeId);
+      if (pointNode) {
+        pointNode.data.pcId = npcId; // 写入 data
+      }
+
       // edge1: source -> pointNode
       const edgeId1 = `${lineType.value}-${connection.source}-${connection.sourceHandle}-${pointNodeId}`;
       const edge1 = {