Skip to content

Commit 31d5421

Browse files
committed
fix id mutation error
1 parent 2ec4580 commit 31d5421

File tree

7 files changed

+14
-16
lines changed

7 files changed

+14
-16
lines changed

example/index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ var myUniqueId = 1;
530530
data: function data() {
531531
// initialize defaults
532532
return {
533+
tableId: null,
533534
options: {
534535
/*eslint-disable */
535536
dom: "tr<'row vdtnet-footer'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'pl>>",
@@ -566,14 +567,11 @@ var myUniqueId = 1;
566567
var jq = vm.jq;
567568
var orders = [];
568569
var startCol = 0;
569-
var icol = 0; // allow user to override default options
570+
var icol = 0;
571+
vm.tableId = vm.id || "vdtnetable".concat(myUniqueId++); // allow user to override default options
570572

571573
if (vm.opts) {
572574
vm.options = jq.extend({}, vm.options, vm.opts);
573-
}
574-
575-
if (!vm.id) {
576-
vm.id = "vdtnetable".concat(myUniqueId++);
577575
} // if fields are passed in, generate column definition
578576
// from our custom fields schema
579577

@@ -22164,7 +22162,7 @@ var staticRenderFns = [
2216422162
{
2216522163
ref: "table",
2216622164
class: _vm.className,
22167-
attrs: { id: _vm.id, cellpadding: "0" }
22165+
attrs: { id: _vm.tableId, cellpadding: "0" }
2216822166
},
2216922167
[
2217022168
_c("thead", [

example/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/mix-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"/index.js": "/index.js?id=dafe225e8d281da0e24b",
3-
"/index.js.map": "/index.js.map?id=410a06bf061a383bed6a"
2+
"/index.js": "/index.js?id=853e6b6a981219e3715e",
3+
"/index.js.map": "/index.js.map?id=4efd61eae652345518b1"
44
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-datatables-net",
33
"description": "Vue jQuery DataTables.net wrapper component",
4-
"version": "1.1.5",
4+
"version": "1.1.6",
55
"author": "[email protected]",
66
"license": "MIT",
77
"main": "lib/index.js",

src/VdtnetTable.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
>
55
<table
66
v-once
7-
:id="id"
7+
:id="tableId"
88
ref="table"
99
:class="className"
1010
cellpadding="0"
@@ -118,6 +118,7 @@ export default {
118118
data() {
119119
// initialize defaults
120120
return {
121+
tableId: null,
121122
options: {
122123
/*eslint-disable */
123124
dom: "tr<'row vdtnet-footer'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'pl>>",
@@ -154,14 +155,13 @@ export default {
154155
let startCol = 0
155156
let icol = 0
156157
158+
vm.tableId = vm.id || `vdtnetable${myUniqueId++}`
159+
157160
// allow user to override default options
158161
if (vm.opts) {
159162
vm.options = jq.extend({}, vm.options, vm.opts)
160163
}
161164
162-
if (!vm.id) {
163-
vm.id = `vdtnetable${myUniqueId++}`
164-
}
165165
166166
// if fields are passed in, generate column definition
167167
// from our custom fields schema

0 commit comments

Comments
 (0)