WEB/Vue.js

[Vuejs] Mdi(Material Design Icons) offline

S0PH1A 2020. 8. 18. 14:00
๋ฐ˜์‘ํ˜•

MDI ์„ค์น˜

$ yarn add @mdi/font -D
// OR
$ npm install @mdi/font -D

๐Ÿ‘ Vue

// plugins/vuetify.js

import '@mdi/font/css/materialdesignicons.css' // Ensure you are using css-loader
import Vue from 'vue'
import Vuetify from 'vuetify/lib'

Vue.use(Vuetify)

export default new Vuetify({
  icons: {
    iconfont: 'mdi', // default - only for display purposes
  },
})

๐Ÿ‘ Nuxt

default ๋กœ iconfont ๊ฐ€ mdi ๋กœ ๋˜์–ด ์žˆ๊ธฐ ๋•Œ๋ฌธ์— css ํŒŒ์ผ๋งŒ ์ถ”๊ฐ€ํ•ด ์ฃผ๋ฉด ๋œ๋‹ค.

// nuxt.config.js

export default {
    css: [
        '@mdi/font/css/materialdesignicons.css',
    ],
}

์ฐธ๊ณ 

๋ฐ˜์‘ํ˜•