Skip to content

Commit 4822764

Browse files
committed
feat: 新增disableCalculateScroll参数
1 parent 2dc259c commit 4822764

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/components/c-table/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class CTable extends Component {
8989
}
9090

9191
componentDidMount() {
92-
this.hasCustomScroll = hasCustomScroll(this.props.useRootWindow);
92+
this.hasCustomScroll = this.props.disableCalculateScroll ? false : hasCustomScroll(this.props.useRootWindow);
9393
if (
9494
(this.props.supportExpend || this.props.supportTree) &&
9595
!this.props.rowKey

src/components/c-table/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ _setColumn 参数:_
159159
| isDelay | 刷新表格时,是否延迟 loading,一般在纯前端表格中使用 | boolean | false | |
160160
| isCheckboxFixed | 是否固定多选框列或单选框列 | boolean | false | |
161161
| ~~useCustomScroll~~ | ~~业务中是否使用自定义滚动条~~,无需设置,原设置过的不影响 | boolean | true | |
162+
| disableCalculateScroll | 是否禁用自定义滚动条的计算 | boolean | false | |
162163
| scrollIntoTop | 翻页后表格自动滚到顶部 | boolean | true | |
163164
| reloadAfterSetColumn | 重新设置表格列后,是否需要刷新表格 | boolean | false | |
164165
| disablePageOnLoad | 切换分页,数据未返回时,是否需要禁用分页按钮 | boolean | true | |

src/components/c-table/js/propType.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export const propTypes = {
8484
rcTableConfig: PropTypes.bool,
8585
configColumnType: PropTypes.oneOf(['default', 'complex']),
8686
configPanelMaxHeight: PropTypes.number,
87+
disableCalculateScroll: PropTypes.bool,
8788
// unControlledCheck: PropTypes.bool,
8889
};
8990

@@ -168,5 +169,6 @@ export const defaultProps = {
168169
rcTableConfig: {},
169170
configColumnType: 'default',
170171
configPanelMaxHeight: undefined,
172+
disableCalculateScroll: false,
171173
// unControlledCheck: false,
172174
};

0 commit comments

Comments
 (0)