alibaba / alibaba/lowcode-engine

「协议」增加 type: 'JSExpression' | 'JSFunction' 结构中 source 字段

Open
#1,271 5 comments 0 reactions 1 assignee Assigned to @liujuping View on GitHub
WIP
Dominant language
TypeScript
Stars
15.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

source 字段可用于填充用户原始输入值,value 字段保存编译后的值,用于运行态。

比如:
![image](https://user-images.githubusercontent.com/1195765/203890342-07107cc6-c5b8-4da4-bf3b-bc767c2699e6.png)

此时 state?.x 在低版本浏览器下可能会直接 crash,假如保存为
```js
{
type: 'JSExpression',
value: 'state ? state.x : undefined', // 手写示意,勿cue
source: 'state?.x'
}
```
则能很好的解决运行态,以及编辑态数据回填的问题,JSFunction 同理~

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.