LoginSignup
1
0

More than 5 years have passed since last update.

Used Material Design UI for Vue2

Last updated at Posted at 2018-07-18

Step 1. Install packages

$ yarn add @fortawesome/fontawesome-free <-- This is optional.
$ yarn add material-design-icons-iconfont <-- This is optional.
$ yarn add vuetify

Step 2. Add Configuration in main.js

  • main.js ( This file is created by vue-cli. )
main.js
import Vuetify from 'vuetify';
import colors from 'vuetify/es5/util/colors';
import 'vuetify/dist/vuetify.css';
import 'material-design-icons-iconfont/dist/material-design-icons.css'; <-- This is optional.
import '@fortawesome/fontawesome-free/css/all.css'; <-- This is optional.

...
...
...
Vue.use(Vuetify, {
  theme: {
    primary: colors.blue.darken2,
    secondary: '#424242',
    accent: '#82B1FF',
    error: '#FF5252',
    info: '#2196F3',
    success: '#4CAF50',
    warning: '#FFC107',
  },
});
...
...
...

Step 3. Modified Webpack Configuration Files

  module: {
    rules: [
      ...
      ...
      ...
      {
        test: /\.(png|jpe?g|gif|svg|eot|ttf|woff|woff2)(\?.+)?$/,
        include: [
          path.resolve('src'),
          path.resolve('node_modules/vuetify/'), <-- Add this.
          path.resolve('node_modules/material-design-icons-iconfont/'), <-- This is optional.
          path.resolve('node_modules/@fortawesome/'), <-- This is optional.
        ],
        use: [
          {
            loader: 'url-loader',
            options: {
              limit: 10000,
            },
          },
        ],
      },
      ...
      ...
      ...
    ],
  },
  module: {
    rules: [
      ...
      ...
      ...
      {
        test: /\.(sa|sc|c)ss$/,
        include: [
          path.resolve('src'),
          path.resolve('node_modules/vuetify/'), <-- Add this.
          path.resolve('node_modules/material-design-icons-iconfont/'), <-- This is optional.
          path.resolve('node_modules/@fortawesome/'), <-- This is optional.
        ],
        use: [
          'vue-style-loader',
          'css-loader',
        ],
      },
      ...
      ...
      ...
    ],
  },

1
0
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
1
0