Hammerbot
Hammerbot

Reputation: 16324

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

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

Upvotes: 10

Views: 4012

Answers (1)

Jackson Miller
Jackson Miller

Reputation: 1510

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

Upvotes: 16

Related Questions