From ba15c9a739efd7625e973e6c5b8e7fd22853b80b Mon Sep 17 00:00:00 2001 From: intellild Date: Tue, 5 Jun 2018 23:00:09 +0800 Subject: [PATCH] remove cloneDeep in Grid --- packages/zent/src/grid/Grid.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/zent/src/grid/Grid.js b/packages/zent/src/grid/Grid.js index d13823f4cf..905699b5d8 100644 --- a/packages/zent/src/grid/Grid.js +++ b/packages/zent/src/grid/Grid.js @@ -16,7 +16,6 @@ import some from 'lodash/some'; import map from 'lodash/map'; import isFunction from 'lodash/isFunction'; import filter from 'lodash/filter'; -import cloneDeep from 'lodash/cloneDeep'; import includes from 'lodash/includes'; import measureScrollbar from 'utils/dom/measureScrollbar'; import WindowResizeHandler from 'utils/component/WindowResizeHandler'; @@ -266,7 +265,7 @@ class Grid extends PureComponent { getColumns = (props, columns, expandRowKeys) => { let { selection, datasets, expandation } = props || this.props; - columns = cloneDeep(columns || this.store.getState('columns')); + columns = (columns || this.store.getState('columns')).slice(); expandRowKeys = expandRowKeys || this.state.expandRowKeys; const hasLeft = columns.some( column => column.fixed === 'left' || column.fixed === true @@ -601,7 +600,7 @@ class Grid extends PureComponent { }; handleBatchSelect = (type, data) => { - let selectedRowKeys = cloneDeep(this.store.getState('selectedRowKeys')); + let selectedRowKeys = this.store.getState('selectedRowKeys').slice(); let changeRowKeys = [];