DataTables / Vue

Vue plugin for DataTables
MIT License
62 stars 12 forks source link

2.1.0 version : table.value.dt is not a function #18

Closed mathieu-dumoutier closed 1 year ago

mathieu-dumoutier commented 1 year ago

Hi!

With version 2.1.0 when I follow this article : https://datatables.net/blog/2022-06-22-vue, I get a "table.value.dt is not a function" error when I try to use API.

It's work with 2.0.0

mathieu-dumoutier commented 1 year ago

and demo seems to be broken : https://stackblitz.com/edit/datatables-net-vue3-reactive?file=src%2FApp.vue

AllanJard commented 1 year ago

Try this one, which is using 2.1.0 of this component: https://stackblitz.com/edit/datatables-net-vue3-reactive-rx2tnv?file=src%2FApp.vue .

Note that it should just be:

onMounted(function () {
  dt = table.value.dt;
});

(i.e. don't execute the dt parameter).

If it isn't working in your application make sure you have the ref="table" attribute in your <DataTable> tag.

mathieu-dumoutier commented 1 year ago

Yes, it's work with dt and not dt() ! Thank you!

So this article https://datatables.net/blog/2022-06-22-vue is obsolete

AllanJard commented 1 year ago

Yes, that's wrong. I'll update it :)