vuetify-loader icon indicating copy to clipboard operation
vuetify-loader copied to clipboard

Feature Request: Automatic icon imports

Open amritk opened this issue 4 years ago • 9 comments

The custom match function has been VERY convenient, as we no longer need to import any of our components. I was wondering if there was any way to do the same but for other things such as svgs. I recently decided to start importing the extra community base material icons, and it would be even more convenient if we could tweak vuetify loader to handle these as well: https://vuetifyjs.com/en/customization/icons#install-material-design-icons-js-svg 2019-08-30:15:28:42

Not a very high priority though, close if there's more important things to worry about!

Cheers

amritk avatar Aug 30 '19 22:08 amritk

It's possible to add, would be a fair bit of work though as we currently don't actually modify anything in the template section. You might want to follow https://github.com/vuetifyjs/vuetify/issues/7821 as well.

KaelWD avatar Aug 31 '19 08:08 KaelWD

Hey @KaelWD, actually there shouldn't be any changes to the template. All you would have to do is import it as a property and not a component. All we would need is a way to specify to vuetify loader whether to add it to the components property or data.

I can poke around the code and maybe make a pull request if I find some time.

amritk avatar Sep 03 '19 23:09 amritk

It also needs to change mdi-account to {{ mdiAccount }} in the template. Not to mention all the other components with props like append-icon

KaelWD avatar Sep 04 '19 02:09 KaelWD

Yea that's true, nevermind then

amritk avatar Sep 04 '19 20:09 amritk

Hi,

I just wrote a module that injects all icon svg on build-time. (Just 130 Lines of code)...

https://github.com/mathe42/vuetify-icon-injector

I need a list for all components with the props that accept icons. (https://github.com/mathe42/vuetify-icon-injector/blob/master/src/index.ts#L6-L8)

If you think that would be nice to inlude in the vuetify-loader I would have a look how this can be done...

mathe42 avatar Mar 02 '20 05:03 mathe42

Any thoughts on this, or plan to work with?

ctwhome avatar Jul 15 '20 06:07 ctwhome

Yes

KaelWD avatar Jul 15 '20 08:07 KaelWD

Is there an ETA for this feature, and will it be available for Vuetify 2?

Excalibaard avatar Mar 09 '22 14:03 Excalibaard

I am using AutoImport plugin with option to autoimport used mdiJS icons image and in code using just variable without import

image

websitevirtuoso avatar Dec 21 '23 00:12 websitevirtuoso