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

可视化搭建内置 API #467

Closed
ascoders opened this issue Feb 12, 2023 · 2 comments
Closed

可视化搭建内置 API #467

ascoders opened this issue Feb 12, 2023 · 2 comments

Comments

@ascoders
Copy link
Owner

ascoders commented Feb 12, 2023

接着上篇,介绍可视化搭建内置的 API,包括提供的内置变量与方法。


可视化搭建内置 API

@tzstone
Copy link

tzstone commented May 21, 2023

关于 setProps/setComponent 的api有一点不解, callback的入参应该分别是对应组件的props和组件实例吧? 这样做的用意是让上层去决定怎么修改props和组件实例吗? 这样的话这两个api本身好像没做啥.

@ascoders
Copy link
Owner Author

@tzstone 就是如此,这个框架不参与业务逻辑,只提供通用函数,目标是统一接口和心智,让业务事半功倍。

我们实际用的话很少会直接调用底层 api,都是业务封装一个更有含义的方法,比如 updatePosition 修改组件位置等等,但这些函数背后的实现调用全是 setProps,维护同学看到这里就会心一笑,不用继续看下去了,整个业务代码背后逻辑也一下子就理顺了。

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