From ffd42b97e6e9ffd801cfda1bc2bbcd484f10e81e Mon Sep 17 00:00:00 2001 From: gx-mac Date: Thu, 11 Mar 2021 20:18:01 +0800 Subject: [PATCH] fix: change NCC record config --- build/Table.js | 2 +- package.json | 2 +- src/Table.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/Table.js b/build/Table.js index fdeec6f..84e8269 100644 --- a/build/Table.js +++ b/build/Table.js @@ -992,7 +992,7 @@ var Table = function (_Component) { var record = data[i]; var key = this.getRowKey(record, i); // 兼容 NCC 以前的业务逻辑,支持外部通过 record 中的 isleaf 字段,判断是否为叶子节点 - record['_isLeaf'] = typeof record['isleaf'] === 'boolean' ? record['isleaf'] : record['_isLeaf']; + typeof record['isleaf'] === 'boolean' && (record['_isLeaf'] = record['isleaf']); // _isLeaf 字段是在 bigData 里添加的,只有层级树大数据场景需要该字段 // _isLeaf 有三种取值情况:true / false / null。(Table内部字段) var _isLeaf = typeof record['_isLeaf'] === 'boolean' ? record['_isLeaf'] : null; diff --git a/package.json b/package.json index 75684c9..21a5095 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bee-table", - "version": "2.3.15-beta.7", + "version": "2.3.15-beta.8", "description": "Table ui component for react", "keywords": [ "react", diff --git a/src/Table.js b/src/Table.js index 357bda0..ac6a113 100644 --- a/src/Table.js +++ b/src/Table.js @@ -791,7 +791,7 @@ class Table extends Component { const record = data[i]; const key = this.getRowKey(record, i); // 兼容 NCC 以前的业务逻辑,支持外部通过 record 中的 isleaf 字段,判断是否为叶子节点 - record['_isLeaf'] = typeof record['isleaf'] === 'boolean' ? record['isleaf'] : record['_isLeaf']; + typeof record['isleaf'] === 'boolean' && (record['_isLeaf'] = record['isleaf']); // _isLeaf 字段是在 bigData 里添加的,只有层级树大数据场景需要该字段 // _isLeaf 有三种取值情况:true / false / null。(Table内部字段) const _isLeaf = typeof record['_isLeaf'] === 'boolean' ? record['_isLeaf'] : null;