diff --git a/src/G6/behaviorConfig.ts b/src/G6/behaviorConfig.ts index 6973518..f74aa99 100644 --- a/src/G6/behaviorConfig.ts +++ b/src/G6/behaviorConfig.ts @@ -2,6 +2,7 @@ import {IG6GraphEvent} from "@antv/g6-core/lib/types"; import {BehaviorOption} from "@antv/g6"; import {useNodeStore} from "@/store/node.ts"; import pinia from "@/store"; +import {INode} from "@antv/g6-core/lib/interface/item"; const nodeStore = useNodeStore(pinia); @@ -12,8 +13,8 @@ export const activateNodeBehavior: BehaviorOption = { }; }, async onNodeClick(evt: IG6GraphEvent) { - const node = evt.item; - console.log(node?.getModel().id); - await nodeStore.updateData(node?.getModel()) + const node: INode = evt.item; + console.log(node.getModel().id); + await nodeStore.updateData(node.getModel()) }, };