Vue, Vuetify is not properly initialized

后端 未结 7 1622
旧时难觅i
旧时难觅i 2021-01-31 20:28

I have setup Vuetify on my Vue webpack application.

My project is setup with vue init webpack my-project running Vue 2.5.2

7条回答
  •  不思量自难忘°
    2021-01-31 20:46

    I do it this way (vue 3.9, vuetify 2.0)

    In main.js (or App.js)

    import vuetify from './plugins/vuetify'
    ...
    new Vue({
      ...
      vuetify,
      render: h => h(App)
    }).$mount('#app')
    

    In plugins/vuetify.js

    import Vue from "vue"
    import Vuetify from "vuetify/lib"
    
    Vue.use(Vuetify)
    
    export default new Vuetify({
      icons: {
        iconfont: 'md',  // 'mdi' || 'mdiSvg' || 'md' || 'fa' || 'fa4'
      },
      theme: {
        dark: false,
      },
      themes: {
        light: {
          primary: "#4682b4",
          secondary: "#b0bec5",
          accent: "#8c9eff",
          error: "#b71c1c",
        },
      },
    })
    

    in App.vue

    
    

提交回复
热议问题