We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我监听了一个广播,把一些组件设为 disabled,但是在从 6.7.0 升级到 6.10.0 之后出现以下报错:
经过排查,原因是 6.8.0 之后,增加了 bindGlobalEventForRenderer 的方式来绑定全局广播事件
amis/packages/amis-core/src/utils/renderer-event.ts
Lines 221 to 226 in d9c07a0
在触发广播事件的时候,这里会把 renderer.context 属性当作事件对象 context.scoped 属性,传递给 runActions。
但因为很多 renderer 的 context 属性是空对象(空对象,而不是空),导致这里无法获取 targetComponent:
amis/packages/amis-core/src/actions/Action.ts
Lines 296 to 300 in d9c07a0
因为这里面涉及到一些底层机制,我不确定从何入手,所以把问题抛出来看看怎么解决?
@2betop
The text was updated successfully, but these errors were encountered:
补充新情况: 当监听广播的 onEvent 位于 service 上时,可以正常触发,印证了前面的分析,即出错的直接原因是 renderer 的 context 属性是空对象。
Sorry, something went wrong.
No branches or pull requests
问题表现
我监听了一个广播,把一些组件设为 disabled,但是在从 6.7.0 升级到 6.10.0 之后出现以下报错:
问题分析
经过排查,原因是 6.8.0 之后,增加了 bindGlobalEventForRenderer 的方式来绑定全局广播事件
amis/packages/amis-core/src/utils/renderer-event.ts
Lines 221 to 226 in d9c07a0
在触发广播事件的时候,这里会把 renderer.context 属性当作事件对象 context.scoped 属性,传递给 runActions。
但因为很多 renderer 的 context 属性是空对象(空对象,而不是空),导致这里无法获取 targetComponent:
amis/packages/amis-core/src/actions/Action.ts
Lines 296 to 300 in d9c07a0
因为这里面涉及到一些底层机制,我不确定从何入手,所以把问题抛出来看看怎么解决?
@2betop
The text was updated successfully, but these errors were encountered: