Skip to content

Commit

Permalink
fix id mutation error
Browse files Browse the repository at this point in the history
  • Loading branch information
noogen committed Jul 11, 2019
1 parent 2ec4580 commit 31d5421
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 16 deletions.
10 changes: 4 additions & 6 deletions example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ var myUniqueId = 1;
data: function data() {
// initialize defaults
return {
tableId: null,
options: {
/*eslint-disable */
dom: "tr<'row vdtnet-footer'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'pl>>",
Expand Down Expand Up @@ -566,14 +567,11 @@ var myUniqueId = 1;
var jq = vm.jq;
var orders = [];
var startCol = 0;
var icol = 0; // allow user to override default options
var icol = 0;
vm.tableId = vm.id || "vdtnetable".concat(myUniqueId++); // allow user to override default options

if (vm.opts) {
vm.options = jq.extend({}, vm.options, vm.opts);
}

if (!vm.id) {
vm.id = "vdtnetable".concat(myUniqueId++);
} // if fields are passed in, generate column definition
// from our custom fields schema

Expand Down Expand Up @@ -22164,7 +22162,7 @@ var staticRenderFns = [
{
ref: "table",
class: _vm.className,
attrs: { id: _vm.id, cellpadding: "0" }
attrs: { id: _vm.tableId, cellpadding: "0" }
},
[
_c("thead", [
Expand Down
2 changes: 1 addition & 1 deletion example/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"/index.js": "/index.js?id=dafe225e8d281da0e24b",
"/index.js.map": "/index.js.map?id=410a06bf061a383bed6a"
"/index.js": "/index.js?id=853e6b6a981219e3715e",
"/index.js.map": "/index.js.map?id=4efd61eae652345518b1"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue-datatables-net",
"description": "Vue jQuery DataTables.net wrapper component",
"version": "1.1.5",
"version": "1.1.6",
"author": "[email protected]",
"license": "MIT",
"main": "lib/index.js",
Expand Down
8 changes: 4 additions & 4 deletions src/VdtnetTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
>
<table
v-once
:id="id"
:id="tableId"
ref="table"
:class="className"
cellpadding="0"
Expand Down Expand Up @@ -118,6 +118,7 @@ export default {
data() {
// initialize defaults
return {
tableId: null,
options: {
/*eslint-disable */
dom: "tr<'row vdtnet-footer'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'pl>>",
Expand Down Expand Up @@ -154,14 +155,13 @@ export default {
let startCol = 0
let icol = 0
vm.tableId = vm.id || `vdtnetable${myUniqueId++}`
// allow user to override default options
if (vm.opts) {
vm.options = jq.extend({}, vm.options, vm.opts)
}
if (!vm.id) {
vm.id = `vdtnetable${myUniqueId++}`
}
// if fields are passed in, generate column definition
// from our custom fields schema
Expand Down

0 comments on commit 31d5421

Please sign in to comment.