From 5797fc4f9c9e572c658c98de4e3876360e2317b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=BE=E3=81=8D=E3=81=A1=E3=82=83=E3=82=93=7E?= Date: Wed, 6 Jun 2018 19:19:25 +0800 Subject: [PATCH] remove cloneDeep in Grid (#855) --- 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 = [];