Search code examples
javascriptvue.jsvuejs3vue-tables-2

vue 3 import vue-tables-3 but i got error: "_vue.default is not a constructor"


I'm trying to use Vue Tables 3 library with Vue 3. Here is my code in main.js:

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import { ClientTable } from 'vue-tables-3'

const app = createApp(App)
app.use(ClientTable)
app.use(store)
app.use(router)
app.mount('#app')

When trying this, I get the following error in browser terminal:

"_vue.default is not a constructor"

I have tried every possible ways how import some plugin but all attempts were unsuccessful.

Does anyone know how to fix please?


Solution

  • This component is not compatible with vue 3 although its name indicates that is compatible which is something that confused you, they say :

    ... We have decided to maintain as a new project. We name it vue-tables-3 because there will also be the version for Vue.js 3 when it is ready.

    but the last publish is more than one year.

    But you could use vue-tables-2 which is compatible with vue 3