P粉6768214902023-08-29 17:10:57
The code below shows an example of adding a custom icon to Vuetify along with the mdi icon set and using both icons in a component via aliases.
vuetify.js
import { createVuetify } from 'vuetify' import { aliases, mdi } from 'vuetify/iconsets/mdi-svg' import folder from '@/customIcons/folderIcon.vue' const aliasesCustom = { ...aliases, folder, } export const vuetify = createVuetify({ icons: { defaultSet: 'mdi', aliases: { ...aliasesCustom }, sets: { mdi, }, }, })
folderIcon.vue (your custom icon)
<template> <svg>...</svg> </template>
Any Securities Regulatory Commission
<template> <v-icon>$folder</v-icon> <v-icon>$mdiGithub</v-icon> </template>
Original source: Thread in Vuetify Discord channel