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

后端 未结 2 1862
滥情空心
滥情空心 2020-11-30 10:25

Vuetify 2.0.0-beta.0 has just been released and I want to try it out and play around in a new vue test application. But I get errors when I try to install it in a fresh new

2条回答
  •  粉色の甜心
    2020-11-30 11:02

    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.

提交回复
热议问题