Created
February 18, 2022 04:38
-
-
Save space88man/655cafd114a80061274b3d4fb187f522 to your computer and use it in GitHub Desktop.
Iconify + Vue3 offline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* install all the icons sets e.g. | |
* npm i @iconify-icons/mdi | |
* npm i @iconify-icons/mdi-light | |
* npm i @iconify-icons/ic | |
* | |
*/ | |
/* | |
* In main.js | |
* import IconifyBundle from '@/assets/bundle-iconify.js'; | |
* | |
* app.component('Icon', IconifyBundle.Icon); | |
* */ | |
/* | |
* Now use <Icon icon="xyz:account-cog" /> in the template | |
* | |
*/ | |
import { addIcon, Icon } from '@iconify/vue/offline'; | |
/* declare all the icons you want to use */ | |
import accountCog from '@iconify-icons/mdi/account-cog'; | |
import home from '@iconify-icons/ic/home'; | |
/* create my own namespace xyz: */ | |
addIcon('xyz:account-cog', accountCog); | |
addIcon('xyz:home', home); | |
export default { | |
Icon: Icon | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment