datatables.net-vue3 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Readme.md CHANGED
@@ -6,7 +6,7 @@ This library provides a Vue 3 component for [DataTables.net](https://datatables.
6
6
  To install:
7
7
 
8
8
  ```
9
- npm install --save datatables.net-vue
9
+ npm install --save datatables.net-vue3
10
10
  ```
11
11
 
12
12
  This will automatically install DataTables as a dependency. Other DataTables extensions can also be installed in your application - see below.
@@ -14,9 +14,14 @@ This will automatically install DataTables as a dependency. Other DataTables ext
14
14
  In your Vue component you can then:
15
15
 
16
16
  ```js
17
- import DataTable from 'datatables.net-vue'
17
+ import DataTable from 'datatables.net-vue3'
18
+ import DataTablesLib from 'datatables.net';
19
+
20
+ DataTable.use(DataTablesLib);
18
21
  ```
19
22
 
23
+ Note how both the DataTables core and DataTables Vue component must both be imported. This is so the extensions for DataTables can also be imported in this scope and used (see below). This behaviour is **new in v2** of this component and is required for compatibility with DataTables 1.13 and newer.
24
+
20
25
  Which makes a `DataTable` component available. It provides the following parameters:
21
26
 
22
27
  * `columns` - Define the columns array used for [DataTables initialisation](https://datatables.net/reference/option/#datatables%20-%20columns)
@@ -46,13 +51,14 @@ The `DataTable` component provides a single slot that can be used to define the
46
51
 
47
52
  ## Extensions
48
53
 
49
- DataTables provides [a wide range of extensions](https://datatables.net/extensions/index) that singificantly expands its abilities. Extensions can be imported from npm and then registered with DataTables through it's `use()` method - e.g.:
54
+ DataTables provides [a wide range of extensions](https://datatables.net/extensions/index) that significantly expands its abilities. Extensions can be imported from npm as modules directly in the script where you wish to make use of them in your DataTable, and then assign the resulting DataTables library to the DataTables Vue3 component - e.g.:
50
55
 
51
56
  ```js
52
- import DataTable from 'datatables.net-vue'
53
- import Select from 'datatables.net-select';
57
+ import DataTable from 'datatables.net-vue3'
58
+ import DataTablesLib from 'datatables.net';
59
+ import 'datatables.net-select';
54
60
 
55
- DataTable.use(Select);
61
+ DataTable.use(DataTablesLib);
56
62
  ```
57
63
 
58
64
 
@@ -67,6 +73,16 @@ npm install datatables.net-bs5
67
73
  npm install datatables.net-select-bs5
68
74
  ```
69
75
 
76
+ Your JS import would then be:
77
+
78
+ ```js
79
+ import DataTable from 'datatables.net-vue3'
80
+ import DataTablesLib from 'datatables.net-bs5';
81
+ import 'datatables.net-select-bs5';
82
+
83
+ DataTable.use(DataTablesLib);
84
+ ```
85
+
70
86
  And in your Vue application's CSS (assuming your are using Vite or some other builder which can resolve the `style` property for npm packages):
71
87
 
72
88
  ```css