File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ class BootstrapTable extends React.Component {
26
26
} )
27
27
} ) ;
28
28
} else {
29
- this . store = new TableDataStore ( this . props . data ) ;
29
+ let copy = this . props . data . slice ( ) ;
30
+ this . store = new TableDataStore ( copy ) ;
30
31
}
31
32
32
33
this . initTable ( this . props ) ;
@@ -117,7 +118,7 @@ class BootstrapTable extends React.Component {
117
118
componentWillReceiveProps ( nextProps ) {
118
119
this . initTable ( nextProps ) ;
119
120
if ( Array . isArray ( nextProps . data ) ) {
120
- this . store . setData ( nextProps . data ) ;
121
+ this . store . setData ( nextProps . data . slice ( ) ) ;
121
122
let paginationDom = this . refs . pagination ;
122
123
let page = paginationDom && paginationDom . getCurrentPage ( ) || nextProps . options . page || 1 ;
123
124
let sizePerPage = paginationDom && paginationDom . getSizePerPage ( ) || nextProps . options . sizePerPage || Const . SIZE_PER_PAGE_LIST [ 0 ] ;
You can’t perform that action at this time.
0 commit comments