How to install vuetify 2.0 beta to the new vue cli project?

柔情痞子 提交于 2019-11-27 05:28:20

After creating a new fresh vue project follow those commands:

# yarn
$ yarn add https://github.com/vuetifyjs/vue-cli-plugin-vuetify.git#dev -D
$ vue invoke vuetify

# npm
$ npm install https://github.com/vuetifyjs/vue-cli-plugin-vuetify.git#dev --save-dev
$ vue invoke vuetify

I think it will even work with the project you have already created. Just try the commands above.

For more check v2.0.0-beta.0 release

Don't include .styl files, it's deprecated basically.
Remove node-sass and install sass

$ npm uninstall node-sass
$ npm i -D sass

And modify your plugins/vuetify.js file

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


Vue.use(Vuetify)
export default new Vuetify({ theme: { ... } })

And main.js

new Vue({
  ...
  vuetify, // we add vuetify here
  render: (h) => h(App),
}).$mount('#app')

Note theme options changed in v2, dark theme can now be customized, e.g.

theme: {
  dark: true,
    themes: {
      light: {
        primary: '#42a5f5',
        ...
      },
      dark: {
        primary: '#2196F3
      },
    },
  },
  options: {
    customProperties: true,
  },
  icons: {
    iconfont: 'md', // default is 'mdi'
  }
}

More in docs, and new style docs with regards to sass.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!