datatable.js on nuxt project (datatable.net)

Viewed 2565

I hope you are doing well. Now I have one doubt about the Nuxt project. It's just responsive Datatables. With the JQuery plugin, I have experience in using the datatable.js, but I am a newbie in SPA development. Especially it's Nuxt. And I have checked a lot of articles, but never find a way to solve this.

Is there any way to solve this?

1 Answers

So the problem was clarified: Datatables.js is based on jQuery and you are working on a Vue application.

While it is perfectly possible to use jQuery and jQuery based solutions inside (or alongside) a Vue application. The way you'd normally use such a solution in HTML/Javascript can be perfectly expressed inside the 'mounted' function of a Vue component (for instance, created would work as well)

There are some costs though, now your product should also ship with jQuery and the library, and you may not enjoy all the benefits of using a vue-based alternative (benefits like Vue's reactivity for instance).

Before making this decision i'd recommend you also have investigate any vue-based alternatives, for instance one of these: https://bestofvuejs.com/t/datatables

Related