Jevon617 / unplugin-svg-component

generate a vue/react component through svg files, supporting svg file HMR, Tree-shaking, SSR and TS hint.
MIT License
58 stars 5 forks source link

feat: support full text scan strategy #2

Closed 0x-jerry closed 1 year ago

0x-jerry commented 1 year ago

At some scenarios, we need to use config file to set icon instead of using SvgIcon directly.

Another scenario is that we may need to wrap a component of SvgIcon to set some extra style and props.

So I made an option scanStrategy to support these scenarios.

BTW, Thank you for made this awesome plugin.

Jevon617 commented 1 year ago

Firstly, Thanks for your PR! In my opinion, the developer should keep this icon name unique when using the text scan strategy, so we should remind the developer in the readme.md, what's more, if the scan strategy can support function type, it will be wonderful!

0x-jerry commented 1 year ago

Yes, using a functional type may be better. However, I believe we need to create another PR. Additionally, I prefer to keep this PR as simple as possible.