9
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Vuetify 2.x でiconが表示されない / cannot show icons using Vuetify(2.x)

Last updated at Posted at 2019-10-16

Vuetify 2.x でiconが表示されない

Vuetify 2系で mdi iconが使えない場合
(<v-icon>mdi-xxx</v-icon>のような場合)
以下のpackageをインストールしてmdi iconを有効化することで解決します。

When you cannot use icons in Vue project which uses Vuetify 2.x
(like <v-icon>mdi-xxx</v-icon>),
you can solve it by adding some packages.

npmの場合 / When using npm

npm
$ npm install @mdi/js file-loader material-design-icons-iconfont --save-dev

yarnの場合 / When using yarn

yarn
$ yarn add @mdi/js file-loader material-design-icons-iconfont -D

vuetify.jsでロードします (load in Vuetify.js)

vuetify.js
import 'material-design-icons-iconfont/dist/material-design-icons.css'
import '@mdi/font/css/materialdesignicons.css'

That's it!

9
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?