Skip to content

Instantly share code, notes, and snippets.

@space88man
Created February 18, 2022 04:38
Show Gist options
  • Save space88man/655cafd114a80061274b3d4fb187f522 to your computer and use it in GitHub Desktop.
Save space88man/655cafd114a80061274b3d4fb187f522 to your computer and use it in GitHub Desktop.
Iconify + Vue3 offline
/* 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