-
Notifications
You must be signed in to change notification settings - Fork 206
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
Register from file #104
Comments
I also want to have this feature. @Justineo Do you have any plan to implement this feature? |
Hi, do you have a proposed usage for this feature? |
@Justineo The usage is like this: We have some customized icons in our website from design. We need to register them before we can use them. And our designer can give us some SVG files for these icons. Now I am thinking if we can register the custom icons from the SVG files directly. Then we can have these benefits:
|
I’m aware of your use case. What I ask earlier is about the proposed API. Currently it’s easy to achieve this by add some webpack loader or a custom script to automatically convert SVG files into JS modules without any modification on the runtime API. |
Agree, this is also what I want to do. But I am still thinking if you can provide a formal way to do this, so that any other people (like me) can easily use the new feature and don't need to spend much time to think how to set the loader or write some custom script. |
For my use case, it would be great if something like this were implemented: import Icon from 'vue-awesome/components/Icon'
Icon.register({
'custom-icon': {
file: 'path/to/icon.svg'
}
}) |
@joshua-s Have you found any practical solution until now? |
This is not possible without a build step (eg. webpack loader). |
@andreiscripcaru22 I have not, actually. I currently update the icons manually when things change. |
@joshua-s So you have custom SVG images that you import and then compile using Vue Awesome? I've been really really struggling to figure out how I can import a provided SVG and register it with Vue Awesome as an icon. |
@GregHattJr I've just been manually copying in the SVG code and using it like this section explains: |
First off, I really appreciate this library. It has been valuable to my work.
It would be really great if it supported registering icons from an SVG file. The current manual creation of paths and shapes is cumbersome and hard to update. Also, the raw option doesn't fit this need very well because it seems to only work with the contents of a layer, rather than the entire svg file.
The text was updated successfully, but these errors were encountered: