alibaba / alibaba/lowcode-engine

源码面板state变量名和数据源面板中名称的关系问题

Open
#2,099 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
15.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

## 现象
在变量面板中绑定state中的变量可以展示出来,但是如果在数据源面板中有和源码面板中state同名的变量就会导致展示不出来。
## 复现步骤
使用官方提供的在线demo。
1. 在源码面板中的state中设置一个变量,例如:infoState
![image](https://github.com/alibaba/lowcode-engine/assets/27946984/6eefce6c-b9b5-4407-83a3-24f2286db698)
2. 拖一个按钮到画布上,绑定这个变量。这时是可以展示出来这个infoState的值的
![image](https://github.com/alibaba/lowcode-engine/assets/27946984/26252f69-4201-4779-8e10-90d5ac7a13bb)
3. 将源码面板中的infoState改成info(数据源面板中有一个默认名字为info的数据源),然后修改按钮的绑定值也为info,这时就会展示不出来
![image](https://github.com/alibaba/lowcode-engine/assets/27946984/fe0a598b-c07a-4f29-967a-8cafb709d911)
![image](https://github.com/alibaba/lowcode-engine/assets/27946984/7cf5d72c-c05a-442e-b6fe-12cb6aece7a0)
4. 如果删除数据源面板中的info数据源就会展示出来了。

## 问题
在setter的变量绑定面板中点击数据源和state中的变量,右边生成的都是this.state.xxx。是不是在运行时将这两个东西合并了?

## 版本信息
![image](https://github.com/alibaba/lowcode-engine/assets/27946984/ca7aaa50-cc63-40ad-8a86-e9b10978f415)

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the collision in the official online demo by binding a button to a state variable, then creating a data source with the same name in the variable binding panel. Compare the generated bindings and runtime display before and after deleting the data source. Done means a state variable remains displayable when a same-named data source exists, with the intended source resolved consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.