Skip to content
New issue

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

模板字符串在解析数组时,会在数组前方添加 ?. #1586

Open
Aliveing opened this issue Dec 6, 2024 · 0 comments
Open

模板字符串在解析数组时,会在数组前方添加 ?. #1586

Aliveing opened this issue Dec 6, 2024 · 0 comments
Assignees

Comments

@Aliveing
Copy link

Aliveing commented Dec 6, 2024

1.依赖仓库的版本(Dependencies versions):

react:18.3.5
form-render:2.5.1
table-render: -
antd:-
2.问题描述(Bug description):
模板字符串在解析数组时,会在数组前方添加 ?.

3.出现问题的 schema demo(Reproduction schema demo):

packages/form-render/src/models/expression.ts 57行

4.最小复现 demo(Reproduction demo):

无需复现 demo 工程,就运行过程举例:

// 假设模板是如下字符串
const funcBody = '{{formData.whenHungary ? ["Self Make", "Order Delivery"] : []}}';

模板解析方法 parseFunc 运行后得到:

// parseFunc('{{formData.whenHungary ? ["Self Make", "Order Delivery"] : []}}')
'{{formData?.whenHungary ? ?.["Self Make", "Order Delivery"] : ?.[]}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants