Browse Source

fix/5282 (#5302)

* Fixed default bug of options.data in multiple tables

* Update example link

Co-authored-by: zhixin <wenzhixin2010@gmail.com>
Dustin Utecht 5 years ago
parent
commit
90f47e7377
2 changed files with 2 additions and 2 deletions
  1. 1 1
      site/docs/api/table-options.md
  2. 1 1
      src/bootstrap-table.js

+ 1 - 1
site/docs/api/table-options.md

@@ -1146,7 +1146,7 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 - **Default:** `false`
 
-- **Example:** [Search Selector](https://examples.bootstrap-table.com/#options/table-search-selector.html)
+- **Example:** [Search Selector](https://examples.bootstrap-table.com/#options/search-selector.html)
 
 ## searchText
 

+ 1 - 1
src/bootstrap-table.js

@@ -407,7 +407,7 @@ class BootstrapTable {
     } else if (type === 'prepend') {
       this.options.data = [].concat(data).concat(this.options.data)
     } else {
-      data = data || this.options.data
+      data = data || [...this.options.data]
       this.options.data = Array.isArray(data) ? data : data[this.options.dataField]
     }