How to connect Vue 3 with Vuetify?

AndrewBro picture AndrewBro · Jul 13, 2020 · Viewed 12.4k times · Source

I initialized a new, empty Vue application using Vue version 3. I then tried to add the plugin Vuetify with the command vue add vuetify, but received the following error. Any ideas on how to solve it?

Error: You cannot call "get" on a collection with no paths.

Answer

Andre Ravazzi picture Andre Ravazzi · Sep 21, 2020

While there is no Vuetify 3, I'd use Vue 2.x with Vuetify 2.x and install the Composition API as a package/plugin:

npm install @vue/composition-api

Then importing to your project (in main.js):

import Vue from 'vue'
import VueCompositionAPI from '@vue/composition-api'

Vue.use(VueCompositionAPI)

And finally using it in your component:

// use the APIs
import { ref, reactive } from '@vue/composition-api'

Just be aware of the limitations of this method.