alibaba / alibaba/lowcode-engine
node-children 中触发 'node.add' 事件的参数错误导致使用document.onMountNode报错
- Dominant language
- TypeScript
- Stars
- 15.9k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
## **Describe the bug (required)** / **详细描述 bug(必填)**
`node-children.ts` 中触发 `node.add` 事件的参数错误导致使用 `document.onMountNode()` 报错
---
## **To Reproduce (required)** / **如何复现 bug?(必填,非常重要)**
编写插件的 `init()` 函数中调用接口,输出结果多一层node,代码如下
```
project.currentDocument.onMountNode((node) => {
console.log('onMountNode', node, node?.node, node.node.parent);
});
```
---
## **Screenshots (optional)** / **bug 截图(可选)**


---
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in node-children.ts and trace where the node.add event is emitted for nodes mounted through document.onMountNode(). Reproduce the issue with the init() callback shown in the report and inspect the callback argument shape. Done means the callback receives the expected Node value without the extra node wrapper or resulting error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100