marc Bolard
marc Bolard

Reputation: 23

error "Unknown custom element..." only for certain Vuetify component like v-expansion-panels

I use some components (v-card, v-toolbar, ...) of Vuetify and overall it works. But for certain compotent like v-expansion-panels, I have this error: "Unknown custom element: < v-expansion-panels > - did you register the component correctly? For recursive components, make sure to provide the "name" option."

I tested several solutions, but nothing works

main.js

import Vue from 'vue'
import './plugins/vuetify.js'
import App from './App.vue'

new Vue({
   router,
  store,
  render: h => h(App)
}).$mount('#app')

vuetify.js

import Vue from 'vue'
import 'vuetify/src/stylus/app.styl'

Vue.use(Vuetify, {
  iconfont: ' md || fa', 

  theme: {
    primary: '#F5A623',
    secondary: '#a9a9a9',
    accent: '#82B1FF',
    error: '#FF5252',
    info: '#2196F3',
    success: '#4CAF50',
    warning: '#FFC107',
  }
})

and my component:

<template>
    <div>
        <v-expansion-panels>
            <v-expansion-panel v-for="(item,i) in 5" :key="i">
                <v-expansion-panel-header>Item</v-expansion-panel-header>
                <v-expansion-panel-content>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</v-expansion-panel-content>
            </v-expansion-panel>
        </v-expansion-panels>
    </div>
</template>

<script>
export default {};

I tried to add the component of different ways in Vuetify.js, for example:

import Vuetify, { VExpansionPanel } from 'vuetify/lib'
Vue.use(Vuetify, {
  components: {
    VExpansionPanel
  },

But any works

otherwise my application works fine. no error in the console.

Thanks for your help

Marco

Upvotes: 2

Views: 873

Answers (1)

Andrew Vasylchuk
Andrew Vasylchuk

Reputation: 4779

Seems like you are using Vuetify 1.5.x, and there is no <v-expansion-panels> component. Either upgrade to Vuetify 2.x or refer to the old documentation about expansion panels.

Upvotes: 2

Related Questions