-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
waiting for authorFurther information is requested from the authorFurther information is requested from the author
Description
问题描述
按官网文档描述:
当 options.silent 为 true 时,不触发 cell:added、node:added 和 edge:added 事件和画布重绘
实际不设置 options.silent或设置为false,均不会触发node:added 事件。是设计如此,还是BUG?
重现链接
https://codesandbox.io/p/devbox/delicate-worker-4m67pn?workspaceId=ws_Jz5W4gLT1GwMTYtJCueoGk
重现步骤
import { Graph } from "@antv/x6";
const graph = new Graph({
container: document.getElementById("container"),
grid: true,
});
graph.on("node:added", () => {
console.log("node:added");
});
graph.fromJSON(
{
nodes: [
{
shape: "rect",
width: 200,
height: 100,
},
],
},
{ silent: false }
);
预期行为
能正确触发node:added事件
平台
- 操作系统: [macOS, Windows, Linux, React Native ...]
- 网页浏览器: [Google Chrome, Safari, Firefox ...]
- X6 版本: [3.1.0 ...]
屏幕截图或视频(可选但最好有)
No response
补充说明(可选)
No response
Metadata
Metadata
Assignees
Labels
waiting for authorFurther information is requested from the authorFurther information is requested from the author