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

Select组件optionApi无限回调 #547

Open
beautyful123 opened this issue Oct 21, 2024 · 0 comments
Open

Select组件optionApi无限回调 #547

beautyful123 opened this issue Oct 21, 2024 · 0 comments

Comments

@beautyful123
Copy link

Form组件optionApi接口返回空数组时,根据代码,length为空会触发回调,造成回调地狱。 仅Select组件会有此问题,TreeSelect组件没问题。自己项目将!item.componentProps?.options.length 判断删除解决
if (
item.optionApi &&
(!item.componentProps?.options || !item.componentProps?.options.length)
) {
// 内部自动调用接口,不影响其它渲染
getOptions(item.optionApi, item)
}

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

1 participant