Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to dynamically use a Vuetify component in vue-cli project

Tags:

vuetify.js

I'm experiencing a problem in my vue-cli created application. The following does not work:

<component :is="'v-text-field'"></component>

However a simple <v-text-field /> works great

The error is:

Unknown custom element: <v-text-field> - did you register the component correctly?

Does someone knows why? I can't reproduce it on codepen

like image 331
Hammerbot Avatar asked Dec 27 '18 13:12

Hammerbot


1 Answers

Are you using vuetify-loader with tree-shaking? If so, you may just want to import {VTextField} from 'vuetify/lib' and add components: { VTextField }

like image 193
Jackson Miller Avatar answered Dec 01 '22 00:12

Jackson Miller