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

How to use mdi-svg #225

Open
BobTheShoplifter opened this issue May 4, 2024 · 7 comments
Open

How to use mdi-svg #225

BobTheShoplifter opened this issue May 4, 2024 · 7 comments

Comments

@BobTheShoplifter
Copy link

BobTheShoplifter commented May 4, 2024

In vue 2 the trick was:

import { mdiArrowDownRight, mdiFormatQuoteOpen, mdiArrowRight } from '@mdi/js'

then

<v-icon size="19" :icon="mdiArrowRight"></v-icon></v-avatar>

But does it auto import the icons when setting

defaultSet: 'mdi-svg',

How can i for example use mdiArrowRight in my page?

@userquin
Copy link
Owner

userquin commented May 4, 2024

If the question is about using it with v-icon you should ask in vuetify repo.

@BobTheShoplifter
Copy link
Author

Importing works but i was wondering how the mdi-svg worked

@userquin
Copy link
Owner

userquin commented May 4, 2024

Check any repo here: https://vuetify-nuxt-module.netlify.app/guide/icons/integrations.html

Basically v-icon accepts an string or a component, it just renders it: @mdi/js just exports the svg icons as js objects, then v-icon just renders the corresponding icon.

@BobTheShoplifter
Copy link
Author

Yeah, i am wondering how do i access the js object that @mdi/js exports?

@userquin
Copy link
Owner

userquin commented May 4, 2024

just import the icon you want: import { mdiArrowDownRight, mdiFormatQuoteOpen, mdiArrowRight } from '@mdi/js'

@BobTheShoplifter
Copy link
Author

Aha! Yes this is what i am doing right now. I just tought the imports was automatic in all components and pages

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

No branches or pull requests

2 participants