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

fix: #3330 异步加载字典导致偶尔出现字典未翻译的问题修复,改为async/await等待加载完成后,才继续执行后续代码 #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

SunJary
Copy link

@SunJary SunJary commented Feb 28, 2023

修复偶尔出现的字典未翻译的问题
原来的watch方法中,存在调用接口来获取数据,是异步操作,如果接口响应较慢,就会出现字典未翻译的情况。
将上述代码改为async/await方式,等待接口返回数据之后再进行后续操作。

由于watch改为了async函数,会导致 "子表默认新增空数据" 功能异常
具体表现为,列数据还未加载成功时,就执行了 "子表默认新增空数据" 操作。会报错,自动产生的列序号、字段默认值等信息无法自动填充。
因此,新增了一个flag字段,用来表示该组件已加载完成,可以进行后续操作了。
getRefPromise获取ref时,会等待组件加载完成后,才进行后续操作。

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

Successfully merging this pull request may close these issues.

1 participant