Home > Blockchain >  How import mdi font to vuetify with vue and vuetify cdn?
How import mdi font to vuetify with vue and vuetify cdn?

Time:01-15

How import mdi font to vutify? Below code does not working. I am using CDN.

const { createApp } = Vue
const { createVuetify } = Vuetify


const vuetify = createVuetify({
  icons: {
    iconfont: 'mdi', //'mdiSvg', //  || 'mdiSvg' || 'md' || 'fa' || 'fa4' || 'faSvg'
  }
})

  createApp({
    delimiters: ['{-', '-}'],
    data() {
      return {
        message: 'Hello Vue!'
      }
    }
  }).use(vuetify).mount('#app')

In html:

<v-btn icon="mdi-dots-vertical" v-bind="props"></v-btn>
<v-icon>mdi-home</v-icon>

CodePudding user response:

Add this to your index.html between <head> tags:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css" />
  • Related