I would like to implement DataTables with my Vue3 application. But have a problem with correct import.
Import according documentation does not work.
var $ = require( 'jquery' );
var dt = require( 'datatables.net' )();
Throws: Cannot set property '$' of undefined
So I tried everything I found but without success. I have a github project with example branch datatables. The code with imports is in main.js file.
Now I have this import
import jQuery from 'jquery/src/jquery.js'
window.$ = window.jQuery = jQuery;
import dataTables from 'datatables.net';
window.dt = dataTables;
Throws: $(...).DataTable is not a function.
I am lost in it. What happened under the DataTables hood why it is not possible to join it with jQuery?
Thanks for any help.