alibaba / alibaba/lowcode-engine
addBuiltinComponentAction 时机能否获取组件的 this scope 值?
- Dominant language
- TypeScript
- Stars
- 15.9k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
背景:想给组件增加一个 action 操作获取当前组件的 this 值,用来做数据绑定的时候方便找到具体层级。
想通过 https://lowcode-engine.cn/site/docs/api/material#%E8%AE%BE%E8%AE%A1%E5%99%A8%E8%BE%85%E5%8A%A9%E5%B1%82 时机获取组件 this 值。
```js
material.addBuiltinComponentAction({
name: 'myIconName',
content: {
icon: () => 'x',
title: 'hover title',
action(node) {
console.log('log => ~ action ~ node:', node)
console.log('myIconName 扩展位被点击')
},
},
important: true,
condition: true,
})
```
目前获取到的 node 如下图:

https://lowcode-engine.cn/site/docs/api/model/node
想要获取的 this 如下,现在都通过console 去调试找数据,很麻烦


---
大概调试了下,没找到 node 怎么获取到 scope/this

Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the material.addBuiltinComponentAction API and the linked designer-helper and node model documentation, then inspect how the action callback receives node. Done means the action can access the current component's this scope or an explicitly documented equivalent without console debugging.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100