baidu / baidu/amis

amisScoped = amis.embed('#root', amisJSON); 运行完后,html里的element并没有创建好,是有异步机制么?能设置为非异步么?

Open
#4,628 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

amisScoped = amis.embed('#root', amisJSON);
运行完后,下面某个js代码需要其中某一个的element id,用于做一些别的工作。
之前1.3.1代码没问题,升级到1.10后,代码出现错误,提示对应的element id未找到,调试发现确实代码运行时没有此element。
怀疑是此行代码原来是运行完已经创建好,现在改为运行完还没创建好了?

能否添加一个选型,是否异步进行此渲染? 或者添加一个渲染完成的回调函数?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the amis.embed('#root', amisJSON) call described in the issue and compare its behavior between versions 1.3.1 and 1.10. Check when the embedded element IDs become available relative to the next JavaScript statement. Done means the timing behavior is documented or a completion mechanism is provided and verified against this usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.