Is there a way to use datattables bootstrap 5 on vue-cli vue3?

Is there a way to use datattables bootstrap 5 on vue-cli vue3?

zuytdtzuytdt Posts: 3Questions: 1Answers: 0

I use datatables on Vue3 with vue-cli, by following the tuts

when I tried use bootstrap 5 with
DataTable.use(DataTableBs5)

but console say:
Uncaught TypeError: Cannot set properties of undefined (setting '$')
at DataTable (jquery.dataTables.js?13b2:109:1)
at Comp.use (datatables.net-vue.esm.js?33ab:26521:1)
That code is working fine with Vite.

How to fix that problem? Thank!

Answers

  • allanallan Posts: 63,530Questions: 1Answers: 10,473 Site admin

    Could you create a test case please? A minimally reproducible git repo would be ideal.

    Allan

  • zuytdtzuytdt Posts: 3Questions: 1Answers: 0

    Yes, it here

    In HelloWorld.vue, you uncomment lines
    //import DataTableBs5 from 'datatables.net-bs5';
    //DataTable.use(DataTableBs5);

    An error message Uncaught TypeError will appear

    Thank you!

  • jnunderwoodjnunderwood Posts: 5Questions: 0Answers: 0

    Hello. I'm having the same problem as well. Any suggestions?

  • zuytdtzuytdt Posts: 3Questions: 1Answers: 0

    I was forced to switch from vue-cli to vite

Sign In or Register to comment.