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

使用 Lit Element 重构搜索组件 #17

Closed
ruibaby opened this issue Oct 24, 2023 · 0 comments · Fixed by #18
Closed

使用 Lit Element 重构搜索组件 #17

ruibaby opened this issue Oct 24, 2023 · 0 comments · Fixed by #18

Comments

@ruibaby
Copy link
Member

ruibaby commented Oct 24, 2023

原因:使用 Lit 构建 Web Component 可以获得更小的体积,目前的方式是将一个完整的 Vue 实例挂载到一个 ShadowDom,本身搜索组件的业务并不大,但最终构建产物在 gzip 之后还有接近 100k。使用 Lit 重构可以尽可能让组件更加存粹,并且封装之后的组件可以应用于各种 JS 框架,甚至不使用框架。

https://lit.dev/

初步验证:

图片

当前版本:

图片
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 a pull request may close this issue.

1 participant