lowcode-engine icon indicating copy to clipboard operation
lowcode-engine copied to clipboard

antd组件场景出码 this.$('xxx')获取不到组件

Open ChiZng opened this issue 2 years ago • 2 comments

Describe the bug (required) / 详细描述 bug(必填)

antd组件场景出码 this.$('xxx')获取不到组件

A clear and concise description of what the bug is. / 请提供清晰且精确的 bug 描述

使用antd组件场景demo,输入框绑定refId,出码后使用this.$('xxx') 拿不到该对象。

To Reproduce (required) / 如何复现 bug?(必填,非常重要)

Steps to reproduce the behavior: / 详细复现步骤:


使用antd组件场景demo,拖一个输入框,输入框高级中设置refId为input1。 拖一个按钮,按钮点击事件绑定 源码面板中的onClick函数。onClick函数中使用this.$('input1') 来获取输入框组件。运行出码后的代码,发现this.$('input1')结果为null。查看this._refsManager发现里面没有input1这个组件。this._refsManager中好多组件都没有。例如Input,进度条等。


Screenshots (optional) / bug 截图(可选)

Sceenshots for further information. (If applicable.) / 一些有用的截图将会帮助我们更好的明确以及定位问题 出码结果 image


Environments (please complete the following information) (required): / 请提供如下信息(必填)

官网的demo例子

  • AliLowCodeEngine version: v1.1.1
  • AliLowCodeEngineExt version: v1.0.5
  • AliLowCodeEngineDemo version: v1.1.12

之前的版本也不行

  • AliLowCodeEngine version: v1.0.18-beta
  • AliLowCodeEngineExt version: v1.0.6-beta
  • AliLowCodeEngineDemo version: v1.0.28
  • materials 1.1.1 或者1.2.1

ChiZng avatar Feb 16 '23 08:02 ChiZng

问题出在 Input 组件没有将 ref 往下传递,导致 ref.current 为 null~

欢迎 PR~ 可以参考 Button 的修改

LeoYuan avatar Feb 24 '23 09:02 LeoYuan

Hello @ChiZng. We totally like your proposal/feedback, PR wanted。

你好 @ChiZng,我们完全同意你的提议/反馈,欢迎 PR。

github-actions[bot] avatar Feb 24 '23 09:02 github-actions[bot]

pr的时候发现有人抢先修改了,感谢。

ChiZng avatar Feb 27 '23 12:02 ChiZng

机会很多哈,搜label:help wanted😃

LeoYuan avatar Feb 27 '23 12:02 LeoYuan