From 3a6443eb9fcfb4d307775be985c24161237d6e00 Mon Sep 17 00:00:00 2001 From: solarjoker Date: Tue, 31 Dec 2019 17:52:56 +0800 Subject: [PATCH] fix: can not hide col when multi-header --- components/table/Header.js | 2 +- components/table/menu/index.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/table/Header.js b/components/table/Header.js index 6d6364d56..b3e45b204 100644 --- a/components/table/Header.js +++ b/components/table/Header.js @@ -131,6 +131,6 @@ export default class Header extends Component { if (origin && origin.url) { sc = false } - Menu.show(e, cbs, key, !!sc, size) + Menu.show(e, cbs, key, !!sc, size, this.props.headerColumns.length === 1) } } diff --git a/components/table/menu/index.js b/components/table/menu/index.js index 6d67b6d62..04b0e39d0 100644 --- a/components/table/menu/index.js +++ b/components/table/menu/index.js @@ -6,13 +6,13 @@ import prifix from '../prefix' class HeaderMenu extends Component { render () { - let {highlighCol, freezeCol, hideCol, index, freeze} = this.props + let {highlighCol, freezeCol, hideCol, index, freeze, canHideCol} = this.props return (

highlighCol(index)} >高亮

{freeze &&

freezeCol(index)} >冻结

} -

hideCol(index)}>隐藏

+ {canHideCol &&

hideCol(index)}>隐藏

}
) } @@ -32,12 +32,12 @@ document.addEventListener('click', () => { setTimeout(hide, 0) }) export default { - show (e, cbs, key, freeze, size = 'normal') { + show (e, cbs, key, freeze, size = 'normal', canHideCol) { div && hide() div = document.createElement('div') div.className = 'hi-table-header-menu-' + size div.style.zIndex = '99999' - ReactDOM.render(, div) + ReactDOM.render(, div) div.style.position = 'absolute' div.style.left = e.pageX + 'px' div.style.top = e.pageY + 'px'