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

关于框架实现的一些问题 #10

Closed
unihon opened this issue Oct 11, 2020 · 2 comments
Closed

关于框架实现的一些问题 #10

unihon opened this issue Oct 11, 2020 · 2 comments

Comments

@unihon
Copy link

unihon commented Oct 11, 2020

目前还在探索阶段,想请教下关于web页面的拖拽预览的实现原理是怎样的,特别是组件的嵌套,预览代码和最终生产代码是如何分离的。

@sparrow-js
Copy link
Owner

目前还在探索阶段,想请教下关于web页面的拖拽预览的实现原理是怎样的,特别是组件的嵌套,预览代码和最终生产代码是如何分离的。

有很多种不同的实现思路,底层都是处理数据,简单说下原理:

  1. 拖拽预览:sortablejs 生成数据
    2.嵌套:递归组件树
    3.预览代码和最终生产代码分离:这个项目预览和生产代码都是编译阶段直接输出的代码,通过状态在组件内部区分输出代码

@unihon
Copy link
Author

unihon commented Oct 12, 2020

都回答了,谢谢

@unihon unihon closed this as completed Oct 12, 2020
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