Vue, Vuetify is not properly initialized

后端 未结 7 1726
旧时难觅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:58

    If you are using vue-cli, Add these lines to file index.html after meta tags:

    
    
    

    And your main.js should look like this:

    // The Vue build version to load with the `import` command
    // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
    import Vue from 'vue'
    import App from './App'
    import router from './router'
    import Vuetify from 'vuetify'
    
    Vue.config.productionTip = false
    Vue.use(Vuetify)
    export default new Vuetify({ })
    
    /* eslint-disable no-new */
    new Vue({
      el: '#app',
      router,
      vuetify: new Vuetify(),
      components: { App },
      template: ''
    })
    

提交回复
热议问题