10
8

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 5 years have passed since last update.

既存nuxt.jsプロジェクトにvuetifyを入れる

Posted at

インストール


npm install --save vuetify

/pluginsでプラグインを入れる

nuxtではroot/plugins以下にプラグイン関係のファイルを作って管理するらしい。
root/plugins/vuetify.js


import Vue from 'vue'
import Vuetify from 'vuetify'

Vue.use(Vuetify)

nuxt.config.jsに記載


module.exports = {
  plugins: ['~plugins/vuetify.js'],
}

このままだとStyleが入らないので、index.vueにスタイルをimport

root/pages/index.vue

<script>
import 'vuetify/dist/vuetify.min.css'
</script>

css-loaderが入っていない場合はそちらも入れておく

npm install --save css-loader

参考

公式
How to use Vuetify in nuxt

10
8
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
10
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?