diff --git a/.eslintrc.js b/.eslintrc.js index 6c3315528..4c1438484 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -41,6 +41,7 @@ module.exports = { 'request', // for Express requests 'res', // for Express responses 'response', // for Express responses + 'cur', ], }], indent: 'off', diff --git a/src/components/grid/uses.js b/src/components/grid/uses.js index e2e5345da..f9c0eb47c 100644 --- a/src/components/grid/uses.js +++ b/src/components/grid/uses.js @@ -160,16 +160,15 @@ export const resizeEvent = (params) => { const bodyEl = elementInfo.body; let elWidth = bodyEl.offsetWidth; const elHeight = bodyEl.offsetHeight; - const result = stores.orderedColumns.reduce((acc, c) => { - const column = c; - if (column.hide) { + const result = stores.orderedColumns.reduce((acc, cur) => { + if (cur.hide) { return acc; } - if (column.field === 'db-icon' || column.field === 'user-icon') { - column.width = resizeInfo.iconWidth; + if (cur.field === 'db-icon' || cur.field === 'user-icon') { + cur.width = resizeInfo.iconWidth; } - if (column.width) { - acc.totalWidth += column.width; + if (cur.width) { + acc.totalWidth += cur.width; } else { acc.emptyCount++; }