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

时间:2018-12-27 13:00:55

标签: 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

1 个答案:

答案 0 :(得分:1)

您是否正在使用vuetify-loader进行摇树?如果是这样,您可能只想import {VTextField} from 'vuetify/lib'并添加components: { VTextField }