LoginSignup
4
0

More than 3 years have passed since last update.

エラー Vue/Vuetify - Unknown custom element: <v-app> - did you register the component correctly?

Last updated at Posted at 2020-01-13

NG

new Vue({
    el: "#app",
    components: { App },
    template: "<App/>"
});

Vue.use(Vuetify);

OK
new Vue()の前にVue.use(Vuetify)しないとダメらしい

Vue.use(Vuetify);

new Vue({
    el: "#app",
    components: { App },
    template: "<App/>"
});

pluginsフォルダを読み込む場合
こんな感じで冗長になる
main.js

import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Vuetify from 'vuetify'
import 'vuetify/dist/vuetify.min.css'
import VueSession from 'vue-session'

import vuetify from './plugins/vuetify'
// import Vuetify from "vuetify/lib"
Vue.use(Vuetify)
Vue.use(VueSession)

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  router,
  store,
  vuetify,
  render: h => h(App)
}).$mount('#app')

4
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0