Vue, Vuetify is not properly initialized

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

    <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.min.css" rel="stylesheet">
    

    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: '<App/>'
    })
    
    0 讨论(0)
提交回复
热议问题