-
Notifications
You must be signed in to change notification settings - Fork 238
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
feat(svg-icon):插件svg-icon #551
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #551 +/- ##
==========================================
+ Coverage 46.65% 47.27% +0.62%
==========================================
Files 66 67 +1
Lines 1584 1599 +15
Branches 443 439 -4
==========================================
+ Hits 739 756 +17
+ Misses 844 842 -2
Partials 1 1
Continue to review full report at Codecov.
|
看用例使用还是有点麻烦,和 svg as component 的方式区别是啥? |
我稍后会整理一下他们的区别,然后更新一下用例,并且打算把Icon这个组件内置到插件中 |
svgo更新新版本了,最跟1.x完全不一样,我最近忙于业务,估计要过点时间去完善了 |
… into umijs-master # Conflicts: # yarn.lock
… into umijs-master # Conflicts: # yarn.lock
@sorrycc 我总结了一下: svg 优点多多,但是,通常我们获得的 svg 图片并不能直接使用,因为它们可能来自第三方 svg 组件库,或者来自设计师的原稿输出,这些 svg 如果直接使用 svg as component 可能存在以下痛点:
当 icon 变得非常多的时候这将是重复的体力劳动。 我个人目前推荐对 svg 使用的是本插件的 svg-icon 与 svg as component 结合使用:
现在我将依赖升级到了最新,并且增加了直接从umi导出的简易模板,感觉使用起来应该没有太多心智负担了 |
我觉得svg是一个比较常用的功能,这个插件通过配置svgo和svg-sprite-loader,达到非常优雅的使用svg的目的